diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-01-26 16:49:58 +0300 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2020-01-26 14:49:58 +0100 |
commit | 4cc6421daa4ff5976ab43c67110a7a80a36541e5 (patch) | |
tree | 0619e24b2663c28c20a12bd31982b9f15866461d /alacritty_terminal/src/term | |
parent | f48204eee20ddb0a3b23c10d27e3c75fbcd3f7f3 (diff) | |
download | alacritty-4cc6421daa4ff5976ab43c67110a7a80a36541e5.tar.gz alacritty-4cc6421daa4ff5976ab43c67110a7a80a36541e5.zip |
Fix incorrect grid.len() and grid.history_size()
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index e1f8fb30..eeacbf7f 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -937,7 +937,7 @@ impl<T> Term<T> { } self.default_cursor_style = config.cursor.style; self.dynamic_title = config.dynamic_title(); - self.grid.update_history(config.scrolling.history() as usize, &self.cursor.template); + self.grid.update_history(config.scrolling.history() as usize); } /// Convert the active selection to a String. @@ -1099,14 +1099,9 @@ impl<T> Term<T> { } // Move prompt down when growing if scrollback lines are available - if num_lines > old_lines { - if self.mode.contains(TermMode::ALT_SCREEN) { - let growage = min(num_lines - old_lines, Line(self.alt_grid.scroll_limit())); - self.cursor_save.point.line += growage; - } else { - let growage = min(num_lines - old_lines, Line(self.grid.scroll_limit())); - self.cursor.point.line += growage; - } + if num_lines > old_lines && !self.mode.contains(TermMode::ALT_SCREEN) { + let growage = min(num_lines - old_lines, Line(self.grid.history_size())); + self.cursor.point.line += growage; } debug!("New num_cols is {} and num_lines is {}", num_cols, num_lines); @@ -2298,6 +2293,11 @@ mod tests { // Make sure that scrolling does not change the grid let mut scrolled_grid = term.grid.clone(); scrolled_grid.scroll_display(Scroll::Top); + + // Truncate grids for comparison + scrolled_grid.truncate(); + term.grid.truncate(); + assert_eq!(term.grid, scrolled_grid); } |