better json printing
This commit is contained in:
parent
3037d0711e
commit
d989f6e31e
2 changed files with 22 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ use tui_widget_list::{ListBuilder, ListView};
|
|||
use crate::tui::{
|
||||
filter::{FilterKind, WipMatcher},
|
||||
log_viewer::{InputState, InputTarget, LogViewer},
|
||||
model::pretty_print_value,
|
||||
};
|
||||
use crate::tui::{
|
||||
filter::{FilterSelection, WipFilter},
|
||||
|
|
@ -473,9 +474,7 @@ impl Widget for &mut App {
|
|||
let Some((k, v)) = &items.get(cx.index) else {
|
||||
return (Paragraph::new(""), 1);
|
||||
};
|
||||
let contents = serde_json::to_string_pretty(&v)
|
||||
.unwrap_or(String::new())
|
||||
.replace("\n", "\n{:width$}");
|
||||
let contents = pretty_print_value(&v);
|
||||
|
||||
let mut res = Paragraph::new(format!("{k:width$} {contents}"))
|
||||
.wrap(Wrap { trim: false });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue