summaryrefslogtreecommitdiff
path: root/tree-viz/src/app.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2023-07-13 10:52:14 +0100
committerAkshay <[email protected]>2023-07-13 10:52:14 +0100
commitf99715d8805a18dc7c16f17275a85a0724e01db9 (patch)
tree2a9bd5845322a6f65cd5dd4f253b8422189dec48 /tree-viz/src/app.rs
parent91d2eb736e18e33972d20faab389257f578cbd7b (diff)
add field names to tree, if any
Diffstat (limited to 'tree-viz/src/app.rs')
-rw-r--r--tree-viz/src/app.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tree-viz/src/app.rs b/tree-viz/src/app.rs
index 68d3641..8581084 100644
--- a/tree-viz/src/app.rs
+++ b/tree-viz/src/app.rs
@@ -105,6 +105,23 @@ impl App {
105 ) 105 )
106 .unwrap(); 106 .unwrap();
107 107
108 if self.config.show_field_name {
109 if let Some(f) = cursor.field_name() {
110 write!(
111 tree_string,
112 "{} ",
113 if in_capture.is_some() {
114 Style::new().on_yellow().on_bright()
115 } else {
116 Style::new()
117 }
118 .yellow()
119 .apply_to(f)
120 )
121 .unwrap()
122 }
123 }
124
108 write!( 125 write!(
109 tree_string, 126 tree_string,
110 "{} ", 127 "{} ",