diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-06-23 23:29:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-23 23:29:01 +0000 |
commit | f002171c84a2b31f156c0401b6b2423e4e77f831 (patch) | |
tree | 8a42e1d7b0192f39cfc3d4fb3d6f35d9361f5a36 /alacritty_terminal/src/term/mod.rs | |
parent | 743d5d9c6614a807ab398473e62fad280845519e (diff) | |
download | alacritty-f002171c84a2b31f156c0401b6b2423e4e77f831.tar.gz alacritty-f002171c84a2b31f156c0401b6b2423e4e77f831.zip |
Fix performance issues with text reflow
Fixes #2567.
Fixes #2414.
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index ee257272..c167875b 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1228,13 +1228,11 @@ impl Term { debug!("New num_cols is {} and num_lines is {}", num_cols, num_lines); // Resize grids to new size - let alt_cursor_point = if self.mode.contains(TermMode::ALT_SCREEN) { - &mut self.cursor_save.point - } else { - &mut self.cursor_save_alt.point - }; - self.grid.resize(num_lines, num_cols, &mut self.cursor.point, &Cell::default()); - self.alt_grid.resize(num_lines, num_cols, alt_cursor_point, &Cell::default()); + let is_alt = self.mode.contains(TermMode::ALT_SCREEN); + let alt_cursor_point = + if is_alt { &mut self.cursor_save.point } else { &mut self.cursor_save_alt.point }; + self.grid.resize(!is_alt, num_lines, num_cols, &mut self.cursor.point, &Cell::default()); + self.alt_grid.resize(is_alt, num_lines, num_cols, alt_cursor_point, &Cell::default()); // Reset scrolling region to new size self.scroll_region = Line(0)..self.grid.num_lines(); |