resize alt screen without reflow

This commit is contained in:
Mitchell Hashimoto
2022-08-08 21:14:27 -07:00
parent f82493cccf
commit 38af14ff3a
2 changed files with 129 additions and 5 deletions

View File

@@ -214,8 +214,6 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols_req: usize, rows: usize) !
const tracy = trace(@src());
defer tracy.end();
// TODO: test, wrapping, etc.
// If we have deccolm supported then we are fixed at either 80 or 132
// columns depending on if mode 3 is set or not.
// TODO: test
@@ -232,9 +230,13 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols_req: usize, rows: usize) !
}
// If we're making the screen smaller, dealloc the unused items.
// TODO: reflow
try self.screen.resize(alloc, rows, cols);
try self.secondary_screen.resize(alloc, rows, cols);
if (self.active_screen == .primary) {
try self.screen.resize(alloc, rows, cols);
try self.secondary_screen.resizeWithoutReflow(alloc, rows, cols);
} else {
try self.screen.resizeWithoutReflow(alloc, rows, cols);
try self.secondary_screen.resize(alloc, rows, cols);
}
// Set our size
self.cols = cols;