diff options
-rw-r--r-- | src/grid/mod.rs | 4 | ||||
-rw-r--r-- | src/term/mod.rs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs index 313973a3..ac54f580 100644 --- a/src/grid/mod.rs +++ b/src/grid/mod.rs @@ -403,6 +403,10 @@ impl<T> Grid<T> { self.cols } + pub fn reset(&mut self) { + self.scroll_limit = 0; + } + pub fn iter_from(&self, point: Point<usize>) -> GridIterator<T> { GridIterator { grid: self, diff --git a/src/term/mod.rs b/src/term/mod.rs index 3f8929b6..3160e86b 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -837,13 +837,11 @@ impl Term { } pub fn new(config: &Config, size: SizeInfo) -> Term { - let template = Cell::default(); - let num_cols = size.cols(); let num_lines = size.lines(); let history_size = config.scrolling().history as usize; - let grid = Grid::new(num_lines, num_cols, history_size, template); + let grid = Grid::new(num_lines, num_cols, history_size, Cell::default()); let tabspaces = config.tabspaces(); let tabs = IndexRange::from(Column(0)..grid.num_cols()) @@ -1818,6 +1816,7 @@ impl ansi::Handler for Term { self.colors = self.original_colors; self.color_modified = [false; color::COUNT]; self.cursor_style = None; + self.grid.reset(); } #[inline] |