summaryrefslogtreecommitdiffstats
path: root/src/interactive/widgets/help.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2021-02-15 14:27:43 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2021-02-15 14:30:45 +0800
commit8b606ac464ec5fa3979ab73fef4d29733d389760 (patch)
treecd8ae85097e122d9dd6c01aa1ca3ab8cf7eb35c4 /src/interactive/widgets/help.rs
parent8cc2f44b4cd89cc046f1748f664d112d0278aa6d (diff)
Add bindings 'H' and 'G' to go to the top/bottom of any pane
Fixes #78
Diffstat (limited to 'src/interactive/widgets/help.rs')
-rw-r--r--src/interactive/widgets/help.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs
index de0dd1b..c7574cc 100644
--- a/src/interactive/widgets/help.rs
+++ b/src/interactive/widgets/help.rs
@@ -33,8 +33,10 @@ fn margin(r: Rect, margin: u16) -> Rect {
}
impl HelpPane {
- pub fn key(&mut self, key: Key) {
+ pub fn process_events(&mut self, key: Key) {
match key {
+ Char('H') => self.scroll_help(CursorDirection::ToTop),
+ Char('G') => self.scroll_help(CursorDirection::ToBottom),
Ctrl('u') | PageUp => self.scroll_help(CursorDirection::PageUp),
Char('k') | Up => self.scroll_help(CursorDirection::Up),
Char('j') | Down => self.scroll_help(CursorDirection::Down),
@@ -120,6 +122,8 @@ impl HelpPane {
hotkey("<Page Down>", "^", None);
hotkey("Ctrl + u", "move up 10 entries at once", None);
hotkey("<Page Up>", "^", None);
+ hotkey("H", "Move to the top of the entries list", None);
+ hotkey("G", "Move to the bottomw of the entries list", None);
spacer();
}
title("Keys for display");