summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid
diff options
context:
space:
mode:
authora5ob7r <12132068+a5ob7r@users.noreply.github.com>2021-12-03 16:45:05 +0900
committerGitHub <noreply@github.com>2021-12-03 07:45:05 +0000
commit7e736c00f68ca133ca3380c1ddd78ba61ced1f8e (patch)
tree20742613e38284289a6f15fe9df2d2bbc5d98f63 /alacritty_terminal/src/grid
parent4c6a763850a5dec0fa34d15e356dcba19875690a (diff)
downloadalacritty-7e736c00f68ca133ca3380c1ddd78ba61ced1f8e.tar.gz
alacritty-7e736c00f68ca133ca3380c1ddd78ba61ced1f8e.zip
Fix crash when vi cursor in history during clear
Fixes #5544.
Diffstat (limited to 'alacritty_terminal/src/grid')
-rw-r--r--alacritty_terminal/src/grid/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs
index df83d7e3..230dc5b5 100644
--- a/alacritty_terminal/src/grid/mod.rs
+++ b/alacritty_terminal/src/grid/mod.rs
@@ -376,6 +376,9 @@ impl<T> Grid<T> {
pub fn clear_history(&mut self) {
// Explicitly purge all lines from history.
self.raw.shrink_lines(self.history_size());
+
+ // Reset display offset.
+ self.display_offset = 0;
}
/// This is used only for initializing after loading ref-tests.