aboutsummaryrefslogtreecommitdiffstats
path: root/src/grid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/grid.rs')
-rw-r--r--src/grid.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/grid.rs b/src/grid.rs
index 2705834..80d44ba 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -60,7 +60,15 @@ impl Grid {
}
}
+ if self.scroll_bottom == self.size.rows - 1 {
+ self.scroll_bottom = size.rows - 1;
+ }
+
self.size = size;
+ for row in &mut self.rows {
+ row.resize(size.cols as usize, crate::cell::Cell::default());
+ }
+ self.rows.resize(size.rows as usize, self.new_row());
if self.scroll_bottom >= size.rows {
self.scroll_bottom = size.rows - 1;