From f45c04f3b269d8a0388e918fe2d6906a0e8f8062 Mon Sep 17 00:00:00 2001 From: Curiosidad-Racional Date: Wed, 17 Nov 2021 06:21:13 +0100 Subject: [PATCH] File find popup up/down keys resolves #977 --- src/components/file_find_popup.rs | 4 ++-- src/keys/key_list.rs | 4 ++++ vim_style_key_config.ron | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/file_find_popup.rs b/src/components/file_find_popup.rs index cce881e810f..530aaae9da1 100644 --- a/src/components/file_find_popup.rs +++ b/src/components/file_find_popup.rs @@ -302,9 +302,9 @@ impl Component for FileFindPopup { || *key == self.key_config.keys.enter { self.hide(); - } else if *key == self.key_config.keys.move_down { + } else if *key == self.key_config.keys.popup_down { self.move_selection(ScrollType::Down); - } else if *key == self.key_config.keys.move_up { + } else if *key == self.key_config.keys.popup_up { self.move_selection(ScrollType::Up); } } diff --git a/src/keys/key_list.rs b/src/keys/key_list.rs index 5f335d22f7c..311d9605157 100644 --- a/src/keys/key_list.rs +++ b/src/keys/key_list.rs @@ -40,6 +40,8 @@ pub struct KeysList { pub end: KeyEvent, pub move_up: KeyEvent, pub move_down: KeyEvent, + pub popup_up: KeyEvent, + pub popup_down: KeyEvent, pub page_down: KeyEvent, pub page_up: KeyEvent, pub shift_up: KeyEvent, @@ -114,6 +116,8 @@ impl Default for KeysList { end: KeyEvent { code: KeyCode::End, modifiers: KeyModifiers::empty()}, move_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::empty()}, move_down: KeyEvent { code: KeyCode::Down, modifiers: KeyModifiers::empty()}, + popup_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::empty()}, + popup_down: KeyEvent { code: KeyCode::Down, modifiers: KeyModifiers::empty()}, page_down: KeyEvent { code: KeyCode::PageDown, modifiers: KeyModifiers::empty()}, page_up: KeyEvent { code: KeyCode::PageUp, modifiers: KeyModifiers::empty()}, shift_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::SHIFT}, diff --git a/vim_style_key_config.ron b/vim_style_key_config.ron index 7938cd85536..e2fde72cc2c 100644 --- a/vim_style_key_config.ron +++ b/vim_style_key_config.ron @@ -44,6 +44,8 @@ end: ( code: End, modifiers: ( bits: 0,),), move_up: ( code: Char('k'), modifiers: ( bits: 0,),), move_down: ( code: Char('j'), modifiers: ( bits: 0,),), + popup_up: ( code: Char('p'), modifiers: ( bits: 2,),), + popup_down: ( code: Char('n'), modifiers: ( bits: 2,),), page_up: ( code: Char('b'), modifiers: ( bits: 2,),), page_down: ( code: Char('f'), modifiers: ( bits: 2,),), tree_collapse_recursive: ( code: Left, modifiers: ( bits: 1,),),