aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-12 08:36:55 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-12 08:38:51 -0500
commitabbc965bc094f95f4754caf2fcca840fd1f0a781 (patch)
tree08bb638d34db07b6afced27036b3dd2188ffc90c /src
parentcbab71b33b10e9779824aa6562dc8c8395a0d2fd (diff)
downloadvt100-rust-abbc965bc094f95f4754caf2fcca840fd1f0a781.tar.gz
vt100-rust-abbc965bc094f95f4754caf2fcca840fd1f0a781.zip
actually resize the underlying grid when requested
Diffstat (limited to 'src')
-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;