diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-03-11 13:01:06 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-15 12:27:12 -0700 |
commit | 70324fc6fc9a85ca2ad6faa296c75ebab2f28afd (patch) | |
tree | 7300bcebf34c67cd3b541bbfd0bdb1364776a0b5 /src/event.rs | |
parent | e7a32b589f6701667bb7c0135491b6800f8716e6 (diff) | |
download | alacritty-70324fc6fc9a85ca2ad6faa296c75ebab2f28afd.tar.gz alacritty-70324fc6fc9a85ca2ad6faa296c75ebab2f28afd.zip |
Replace scrolling methods with enum
The different scrolling methods added a bunch of boilerplate where the
call was just forwarded to the next struct, this has been removed by
making the scroll amount into a struct.
Now everything is called through one method and the parameter decides
how far the viewport should be scrolled.
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/event.rs b/src/event.rs index 322f0278..4d50efda 100644 --- a/src/event.rs +++ b/src/event.rs @@ -10,6 +10,7 @@ use parking_lot::MutexGuard; use glutin::{self, ModifiersState, Event, ElementState}; use copypasta::{Clipboard, Load, Store}; +use grid::Scroll; use config::{self, Config}; use cli::Options; use display::OnResize; @@ -53,24 +54,8 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> { *self.size_info } - fn scroll(&mut self, count: isize) { - self.terminal.scroll_display(count); - } - - fn reset_scroll(&mut self) { - self.terminal.reset_scroll(); - } - - fn scroll_to_top(&mut self) { - self.terminal.scroll_to_top(); - } - - fn scroll_page_up(&mut self) { - self.terminal.scroll_page_up(); - } - - fn scroll_page_down(&mut self) { - self.terminal.scroll_page_down(); + fn scroll(&mut self, scroll: Scroll) { + self.terminal.scroll_display(scroll); } fn copy_selection(&self, buffer: ::copypasta::Buffer) { |