diff --git a/src/IO/Input.py b/src/IO/Input.py index 22fca9f..574d83f 100644 --- a/src/IO/Input.py +++ b/src/IO/Input.py @@ -30,6 +30,8 @@ class Input: "search": self._search, "search_next": self._search_next, "search_previous": self._search_previous, + "go_top": self._go_top, + "go_bottom": self._go_bottom, } def handle(self, key: str) -> bool: @@ -78,6 +80,16 @@ class Input: self.app.navigator.cursor.up() return True + def _go_top(self) -> bool: + self.app.navigator.cursor.set(0) + return True + + def _go_bottom(self) -> bool: + navigator = self.app.navigator + if navigator.items: + navigator.cursor.set(len(navigator.items) - 1) + return True + def _maybe_show_error(self) -> None: error = self.app.navigator.error if error: diff --git a/src/core/Config.py b/src/core/Config.py index 66efec4..1759cb2 100644 --- a/src/core/Config.py +++ b/src/core/Config.py @@ -21,6 +21,8 @@ DEFAULT_KEYBINDS: dict[str, list[str]] = { "search": ["/"], "search_next": ["n"], "search_previous": ["N"], + "go_top": ["g"], + "go_bottom": ["G"], } DEFAULT_CURSOR_RESET = "top"