diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-02-15 14:27:43 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-02-15 14:30:45 +0800 |
commit | 8b606ac464ec5fa3979ab73fef4d29733d389760 (patch) | |
tree | cd8ae85097e122d9dd6c01aa1ca3ab8cf7eb35c4 /src/interactive/widgets/mark.rs | |
parent | 8cc2f44b4cd89cc046f1748f664d112d0278aa6d (diff) |
Add bindings 'H' and 'G' to go to the top/bottom of any pane
Fixes #78
Diffstat (limited to 'src/interactive/widgets/mark.rs')
-rw-r--r-- | src/interactive/widgets/mark.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs index cdae961..b165415 100644 --- a/src/interactive/widgets/mark.rs +++ b/src/interactive/widgets/mark.rs @@ -102,13 +102,15 @@ impl MarkPane { pub fn marked(&self) -> &EntryMarkMap { &self.marked } - pub fn key(mut self, key: Key) -> Option<(Self, Option<MarkMode>)> { + pub fn process_events(mut self, key: Key) -> Option<(Self, Option<MarkMode>)> { let action = None; match key { Ctrl('r') => return self.prepare_deletion(), Char('x') | Char('d') | Char(' ') => { return self.remove_selected().map(|s| (s, action)) } + Char('H') => self.change_selection(CursorDirection::ToTop), + Char('G') => self.change_selection(CursorDirection::ToBottom), Ctrl('u') | PageUp => self.change_selection(CursorDirection::PageUp), Char('k') | Up => self.change_selection(CursorDirection::Up), Char('j') | Down => self.change_selection(CursorDirection::Down), |