From 7ecf93ec7061869713ebaa07384ad7a935c4a4d5 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 12 Feb 2020 23:24:24 +0300 Subject: [PATCH] Fix incorrect display offset after rotation Regression was introduced in 4cc6421daa4ff5976ab43c67110a7a80a36541e5, however it was working before only due to grid.len() bug. --- alacritty_terminal/src/grid/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index d1ccd320..febdff69 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -523,7 +523,7 @@ impl Grid { if region.start == Line(0) { // Update display offset when not pinned to active area if self.display_offset != 0 { - self.display_offset = min(self.display_offset + *positions, self.len() - num_lines); + self.display_offset = min(self.display_offset + *positions, self.max_scroll_limit); } self.increase_scroll_limit(*positions, template);