on master help sign in
Add c-j c-k to menu keymap for move_up move_down (#908)
bca98b5CossonLeo
helix-term/src/ui/menu.rs+8
@@ -214,6 +214,10 @@ impl<T: Item + 'static> Component for Menu<T> {
214 | KeyEvent {
214 | KeyEvent {
215 code: KeyCode::Char('p'),
215 code: KeyCode::Char('p'),
216 modifiers: KeyModifiers::CONTROL,
216 modifiers: KeyModifiers::CONTROL,
217+ }
218+ | KeyEvent {
219+ code: KeyCode::Char('k'),
220+ modifiers: KeyModifiers::CONTROL,
217 } => {
221 } => {
218 self.move_up();
222 self.move_up();
219 (self.callback_fn)(cx.editor, self.selection(), MenuEvent::Update);
223 (self.callback_fn)(cx.editor, self.selection(), MenuEvent::Update);
@@ -231,6 +235,10 @@ impl<T: Item + 'static> Component for Menu<T> {
231 | KeyEvent {
235 | KeyEvent {
232 code: KeyCode::Char('n'),
236 code: KeyCode::Char('n'),
233 modifiers: KeyModifiers::CONTROL,
237 modifiers: KeyModifiers::CONTROL,
238+ }
239+ | KeyEvent {
240+ code: KeyCode::Char('j'),
241+ modifiers: KeyModifiers::CONTROL,
234 } => {
242 } => {
235 self.move_down();
243 self.move_down();
236 (self.callback_fn)(cx.editor, self.selection(), MenuEvent::Update);
244 (self.callback_fn)(cx.editor, self.selection(), MenuEvent::Update);