summaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-03-11 13:01:06 +0100
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:56:50 -0700
commit0dcb9ca6a871fd6d28787142a134c9190001ac43 (patch)
tree8f1f4845942c7af562173b9e670ca61664ee49ee /src/event.rs
parent2c7bb9a4d3ce3ead6de4ca6485ca67c44c0bd1c1 (diff)
downloadalacritty-0dcb9ca6a871fd6d28787142a134c9190001ac43.tar.gz
alacritty-0dcb9ca6a871fd6d28787142a134c9190001ac43.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.rs21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/event.rs b/src/event.rs
index 4823d824..cf7d1030 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) {