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/term/mod.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/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 8f9fee1b..c97cd84d 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -24,7 +24,7 @@ use unicode_width::UnicodeWidthChar; use font::{self, Size}; use ansi::{self, Color, NamedColor, Attr, Handler, CharsetIndex, StandardCharset, CursorStyle}; -use grid::{BidirectionalIterator, Grid, Indexed, IndexRegion, DisplayIter}; +use grid::{BidirectionalIterator, Grid, Indexed, IndexRegion, DisplayIter, Scroll}; use index::{self, Point, Column, Line, IndexRange, Contains, RangeInclusive, Linear}; use selection::{self, Selection, Locations}; use config::{Config, VisualBellAnimation}; @@ -823,28 +823,8 @@ impl Term { self.next_title.take() } - pub fn scroll_display(&mut self, count: isize) { - self.grid.scroll_display(count); - self.dirty = true; - } - - pub fn reset_scroll(&mut self) { - self.grid.reset_scroll_display(); - self.dirty = true; - } - - pub fn scroll_to_top(&mut self) { - self.grid.scroll_to_top(); - self.dirty = true; - } - - pub fn scroll_page_up(&mut self) { - self.grid.scroll_page_up(); - self.dirty = true; - } - - pub fn scroll_page_down(&mut self) { - self.grid.scroll_page_down(); + pub fn scroll_display(&mut self, scroll: Scroll) { + self.grid.scroll_display(scroll); self.dirty = true; } |