diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-06-25 09:50:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 09:50:17 +0000 |
commit | 6c8966f426552065f2846c0c1f555d02aba98141 (patch) | |
tree | 2dca6b7192fa77d0ee39d059095616daa05c1744 /alacritty_terminal/src/grid | |
parent | f0775b3c89e92b92b74d5c9138a9770af80f589f (diff) | |
download | alacritty-6c8966f426552065f2846c0c1f555d02aba98141.tar.gz alacritty-6c8966f426552065f2846c0c1f555d02aba98141.zip |
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.
Diffstat (limited to 'alacritty_terminal/src/grid')
-rw-r--r-- | alacritty_terminal/src/grid/mod.rs | 4 |
1 files changed, 1 insertions, 3 deletions
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<T: GridCell + Default + PartialEq + Copy> Grid<T> { // 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) { |