mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-23 04:06:13 +03:00
terminal: resizing greater cols without reflow should preserve cols
This commit is contained in:
@ -1247,8 +1247,15 @@ fn resizeWithoutReflow(self: *PageList, opts: Resize) !void {
|
|||||||
// pages may not have the capacity for this. If they don't have
|
// pages may not have the capacity for this. If they don't have
|
||||||
// the capacity we need to allocate a new page and copy the data.
|
// the capacity we need to allocate a new page and copy the data.
|
||||||
.gt => {
|
.gt => {
|
||||||
|
// See the comment in the while loop when setting self.cols
|
||||||
|
const old_cols = self.cols;
|
||||||
|
|
||||||
var it = self.pageIterator(.right_down, .{ .screen = .{} }, null);
|
var it = self.pageIterator(.right_down, .{ .screen = .{} }, null);
|
||||||
while (it.next()) |chunk| {
|
while (it.next()) |chunk| {
|
||||||
|
// We need to restore our old cols after we resize because
|
||||||
|
// we have an assertion on this and we want to be able to
|
||||||
|
// call this method multiple times.
|
||||||
|
self.cols = old_cols;
|
||||||
try self.resizeWithoutReflowGrowCols(cols, chunk);
|
try self.resizeWithoutReflowGrowCols(cols, chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user