summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-03-02 18:32:48 +0000
committerGitHub <noreply@github.com>2019-03-02 18:32:48 +0000
commit3c4bb7c11518e1ced9feeb156436d55fe1d4a66b (patch)
tree982ed81edc2bb9bea6b21dfc461fe8a509e78963 /src
parente0fdc3329c4ca06e5853401e9c7c04f16b28eba3 (diff)
downloadalacritty-3c4bb7c11518e1ced9feeb156436d55fe1d4a66b.tar.gz
alacritty-3c4bb7c11518e1ced9feeb156436d55fe1d4a66b.zip
Fix scrollback live reloading
This fixes two issues with live reloading the `scrolling.history` property. It is now possible to increase the scrollback history without restarting Alacritty. When decreasing the scrollback history while scrolled beyond the new history limit, Alacritty will reset the viewport position to the new limit instead of crashing. This fixes #2147.
Diffstat (limited to 'src')
-rw-r--r--src/grid/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index fd22b716..7766f9a9 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -163,7 +163,9 @@ impl<T: Copy + Clone> Grid<T> {
pub fn update_history(&mut self, history_size: usize, template: &T)
{
self.raw.update_history(history_size, Row::new(self.cols, &template));
+ self.max_scroll_limit = history_size;
self.scroll_limit = min(self.scroll_limit, history_size);
+ self.display_offset = min(self.display_offset, self.scroll_limit);
}
pub fn scroll_display(&mut self, scroll: Scroll) {