summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid/mod.rs
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2021-03-31 21:11:16 +0200
committerGitHub <noreply@github.com>2021-03-31 19:11:16 +0000
commit58cae8f2edf44e6bf0721543c61edb57bdf7d776 (patch)
tree4f20cae7d3069ccc8e03ffee514a5d0605f85b9e /alacritty_terminal/src/grid/mod.rs
parent3bd5ac221ab3b122962063edd1f4c10f9f2d117f (diff)
downloadalacritty-58cae8f2edf44e6bf0721543c61edb57bdf7d776.tar.gz
alacritty-58cae8f2edf44e6bf0721543c61edb57bdf7d776.zip
Keep viewport in place during resize
Fixes #4879. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src/grid/mod.rs')
-rw-r--r--alacritty_terminal/src/grid/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs
index 169067af..06af3bea 100644
--- a/alacritty_terminal/src/grid/mod.rs
+++ b/alacritty_terminal/src/grid/mod.rs
@@ -502,7 +502,7 @@ pub trait Dimensions {
/// Number of invisible lines part of the scrollback history.
#[inline]
fn history_size(&self) -> usize {
- self.total_lines() - self.screen_lines()
+ self.total_lines().saturating_sub(self.screen_lines())
}
}