aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.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/term/mod.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/term/mod.rs')
-rw-r--r--src/term/mod.rs26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 8e973b0b..3c7ef87c 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};
@@ -824,28 +824,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;
}