From abbc965bc094f95f4754caf2fcca840fd1f0a781 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 12 Nov 2019 08:36:55 -0500 Subject: actually resize the underlying grid when requested --- src/grid.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-54-g00ecf