diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-03-10 20:24:10 +0100 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2018-06-02 09:56:50 -0700 |
commit | 2c7bb9a4d3ce3ead6de4ca6485ca67c44c0bd1c1 (patch) | |
tree | 68616e8f2d0c2018d766d8462dc122bea1d70923 /src/input.rs | |
parent | e20aa550cbcf7b3f7be6757c007960b3f9b1ac08 (diff) | |
download | alacritty-2c7bb9a4d3ce3ead6de4ca6485ca67c44c0bd1c1.tar.gz alacritty-2c7bb9a4d3ce3ead6de4ca6485ca67c44c0bd1c1.zip |
Add scrollback hotkeys
This offers a few additional hotkeys that can be used in combination
with scrollback. None of these are used by default yet.
This implements the following bindings:
- ScrollPageUp: Scroll exactly one screen height up
- ScrollPageDown: Scroll exactly one screen height down
- ScrollToTop: Scroll as far up as possible
- ScrollToBottom: Scroll as far down as possible
This fixes #1151.
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/input.rs b/src/input.rs index 98e0d241..adce3448 100644 --- a/src/input.rs +++ b/src/input.rs @@ -65,8 +65,11 @@ pub trait ActionContext { fn last_modifiers(&mut self) -> &mut ModifiersState; fn change_font_size(&mut self, delta: i8); fn reset_font_size(&mut self); - fn scroll(&mut self, count: isize) {} - fn reset_scroll(&mut self) {} + fn scroll(&mut self, count: isize); + fn reset_scroll(&mut self); + fn scroll_to_top(&mut self); + fn scroll_page_up(&mut self); + fn scroll_page_down(&mut self); } /// Describes a state and action to take in that state @@ -168,6 +171,18 @@ pub enum Action { /// Reset font size to the config value ResetFontSize, + /// Scroll exactly one page up + ScrollPageUp, + + /// Scroll exactly one page down + ScrollPageDown, + + /// Scroll all the way to the top + ScrollToTop, + + /// Scroll all the way to the bottom + ScrollToBottom, + /// Run given command Command(String, Vec<String>), @@ -237,7 +252,19 @@ impl Action { } Action::ResetFontSize => { ctx.reset_font_size(); - } + }, + Action::ScrollPageUp => { + ctx.scroll_page_up(); + }, + Action::ScrollPageDown => { + ctx.scroll_page_down(); + }, + Action::ScrollToTop => { + ctx.scroll_to_top(); + }, + Action::ScrollToBottom => { + ctx.reset_scroll(); + }, } } |