From 6c8966f426552065f2846c0c1f555d02aba98141 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 25 Jun 2020 09:50:17 +0000 Subject: Fix scroll down escape pulling lines from history This works around a bug where the optimized version of the `Grid::scroll_down` function would just rotate the entire grid down if the scrolling region starts at the top of the screen, even if there is history available. Since rotations of scrolling regions should not affect the scrollback history, this optimized version is now only called when the max scrollback size is 0, making it impossible for the grid to have any history while it is used. Since the main usecase of this is the alternate screen buffer, which never has any history, the performance should not be affected negatively by this change. Fixes #3582. --- alacritty_terminal/src/grid/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'alacritty_terminal/src') diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index d5932639..5178ed99 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -238,13 +238,11 @@ impl Grid { // changing the start index. // // To accommodate scroll regions, rows are reordered at the end. - if region.start == Line(0) { + if region.start == Line(0) && self.max_scroll_limit == 0 { // Rotate the entire line buffer. If there's a scrolling region // active, the bottom lines are restored in the next step. self.raw.rotate_up(*positions); - self.decrease_scroll_limit(*positions); - // Now, restore any scroll region lines. let lines = self.lines; for i in IndexRange(region.end..lines) { -- cgit