diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-06 18:03:25 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-06 18:03:25 +0530 |
commit | 4c354f475bfe841f3797be0a3341212aeeaa60c8 (patch) | |
tree | a25bb95b1d182474856ca42b3463dd12c054445e /src/interactive/widgets/help.rs | |
parent | 29c0cf3c5a584764e060dd9f34592edbc8098562 (diff) |
some experimentation with selection handling in the new pane
It's entirely different from the first one :D, incredible
Diffstat (limited to 'src/interactive/widgets/help.rs')
-rw-r--r-- | src/interactive/widgets/help.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs index 07ca3e6..02698e6 100644 --- a/src/interactive/widgets/help.rs +++ b/src/interactive/widgets/help.rs @@ -1,4 +1,4 @@ -use crate::interactive::{CursorDirection, Handle}; +use crate::interactive::CursorDirection; use std::borrow::Borrow; use std::cell::{Cell, RefCell}; use termion::event::Key; @@ -20,8 +20,8 @@ pub struct HelpPaneProps { pub border_style: Style, } -impl Handle for HelpPane { - fn key(&mut self, key: Key) { +impl HelpPane { + pub fn key(&mut self, key: Key) { match key { Ctrl('u') | PageUp => self.scroll_help(CursorDirection::PageUp), Char('k') | Up => self.scroll_help(CursorDirection::Up), @@ -30,9 +30,6 @@ impl Handle for HelpPane { _ => {} }; } -} - -impl HelpPane { fn scroll_help(&mut self, direction: CursorDirection) { self.scroll = direction.move_cursor(self.scroll as usize) as u16; } |