Add ctrl+n / ctrl+p as shortcuts for down and up

ctrl+n is used for "next item" aka down, ctrl+p as "previous item" aka
up.

Fixes #1
This commit is contained in:
Sebastian Lohff 2023-02-16 18:04:32 +01:00
parent 26412d400f
commit fdfd0d0101
1 changed files with 2 additions and 0 deletions

View File

@ -293,11 +293,13 @@ class CliMenu:
@self._kb.add('down', filter=~is_searching) @self._kb.add('down', filter=~is_searching)
@self._kb.add('j', filter=~is_searching) @self._kb.add('j', filter=~is_searching)
@self._kb.add('c-n', filter=~is_searching)
def down(event): def down(event):
self.next_item(1) self.next_item(1)
@self._kb.add('up', filter=~is_searching) @self._kb.add('up', filter=~is_searching)
@self._kb.add('k', filter=~is_searching) @self._kb.add('k', filter=~is_searching)
@self._kb.add('c-p', filter=~is_searching)
def up(event): def up(event):
self.next_item(-1) self.next_item(-1)