diff options
author | Nathan Lilienthal <nathan@nixpulvis.com> | 2019-11-18 16:15:25 -0500 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-11-18 22:15:25 +0100 |
commit | 182a9d5c2e01ec9b155fc7edf547e8e6de2f2bd5 (patch) | |
tree | 56889a5b18e40c7f4b30ea53b8eb152fbeb82a2d /alacritty_terminal/src/grid/row.rs | |
parent | bcdc605436ebe137173c531844a739eda6ee41ae (diff) | |
download | r-alacritty-182a9d5c2e01ec9b155fc7edf547e8e6de2f2bd5.tar.gz r-alacritty-182a9d5c2e01ec9b155fc7edf547e8e6de2f2bd5.tar.bz2 r-alacritty-182a9d5c2e01ec9b155fc7edf547e8e6de2f2bd5.zip |
Fix deletion of lines when clearing the screen
Previously Alacritty would delete lines when clearing the screen, leading to a
loss of data in the scrollback buffer. Instead of deleting these lines, they
are now rotated outside of the visible region.
This also fixes some issues with Alacritty only resetting lines partially when
the background color of the template cell changed.
Fixes #2199.
Diffstat (limited to 'alacritty_terminal/src/grid/row.rs')
-rw-r--r-- | alacritty_terminal/src/grid/row.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs index 058583f2..daee4408 100644 --- a/alacritty_terminal/src/grid/row.rs +++ b/alacritty_terminal/src/grid/row.rs @@ -90,12 +90,15 @@ impl<T: Copy> Row<T> { where T: GridCell, { - for item in &mut self.inner[..self.occ] { - *item = *template; - } - if template.is_empty() { + for item in &mut self.inner[..self.occ] { + *item = *template; + } self.occ = 0; + } else { + let len = self.inner.len(); + self.inner = vec![*template; len]; + self.occ = len; } } } |