diff options
Diffstat (limited to 'alacritty_terminal/src/grid/resize.rs')
-rw-r--r-- | alacritty_terminal/src/grid/resize.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/alacritty_terminal/src/grid/resize.rs b/alacritty_terminal/src/grid/resize.rs index eb8bef0c..10bc51f9 100644 --- a/alacritty_terminal/src/grid/resize.rs +++ b/alacritty_terminal/src/grid/resize.rs @@ -187,7 +187,7 @@ impl<T: GridCell + Default + PartialEq + Clone> Grid<T> { cursor_line_delta += line_delta.0 as usize; } else if row.is_clear() { - if i + reversed.len() >= self.lines { + if i <= self.display_offset { // Since we removed a line, rotate down the viewport. self.display_offset = self.display_offset.saturating_sub(1); } @@ -354,6 +354,11 @@ impl<T: GridCell + Default + PartialEq + Clone> Grid<T> { wrapped.resize_with(columns, T::default); } row = Row::from_vec(wrapped, occ); + + if i <= self.display_offset { + // Since we added a new line, rotate up the viewport. + self.display_offset += 1; + } } } } |