aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2018-05-29 11:15:03 -0700
committerJoe Wilm <joe@jwilm.com>2018-05-29 21:06:38 -0700
commit0bd08a80ff53b768d6e8a68c3744e321581571b8 (patch)
tree9ddab08651604e6b63d376d6469f5d5abf881762
parent63de0559dd3105000ffe56376af4641b0908c34b (diff)
downloadalacritty-0bd08a80ff53b768d6e8a68c3744e321581571b8.tar.gz
alacritty-0bd08a80ff53b768d6e8a68c3744e321581571b8.zip
Fix issue with endless allocation loop
Shrinking columns wasn't updating hidden rows in the storage buffer on resizing. When growing the columns again, this resulted in an endless allocation loop. Only one real change was made here, and that was `raw.iter_mut()` to `raw.iter_mut_raw()`. The method `shrink_cols` was relocated to be adjacent to `grow_cols` in the code.
-rw-r--r--src/grid/mod.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index 0998d640..c9829c2e 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -252,6 +252,14 @@ impl<T: Copy + Clone> Grid<T> {
self.cols = cols;
}
+ fn shrink_cols(&mut self, cols: index::Column) {
+ for row in self.raw.iter_mut_raw() {
+ row.shrink(cols);
+ }
+
+ self.cols = cols;
+ }
+
/// Remove lines from the visible area
///
/// The behavior in Terminal.app and iTerm.app is to keep the cursor at the
@@ -437,14 +445,6 @@ impl<T> Grid<T> {
// pub fn swap_lines(&mut self, src: index::Line, dst: index::Line) {
// self.raw.swap(*src, *dst);
// }
-
- fn shrink_cols(&mut self, cols: index::Column) {
- for row in self.raw.iter_mut() {
- row.shrink(cols);
- }
-
- self.cols = cols;
- }
}
impl<'a, T> Iterator for GridIterator<'a, T> {