structured data editor
git clone https://git.lucas.co/cce-data-editor.git
Added keyboard shortcuts ctrl+f and slash to focus the search box
src/main.rs | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index 7947431..ae34856 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1855,7 +1855,11 @@ impl Application for DataEditorApp {
handled = true;
}
"f" => {
- msg_out = Some(AppMessage::FormatJson);
+ if event.shift {
+ msg_out = Some(AppMessage::FormatJson);
+ } else {
+ self.tree_list.focus_search(&mut self.ui_context);
+ }
handled = true;
}
"=" | "+" => {
@@ -1879,6 +1883,15 @@ impl Application for DataEditorApp {
}
}
+ if !event.ctrl && event.state == ElementState::Pressed {
+ if let Key::Character(ref ch) = event.logical_key {
+ if ch == "/" && self.ui_context.focused_widget.is_none() {
+ self.tree_list.focus_search(&mut self.ui_context);
+ handled = true;
+ }
+ }
+ }
+
if !handled {
if self.btn_open.keyboard_input(event, &mut self.ui_context) {
handled = true;