diff --git a/src/terminal/PageList.zig b/src/terminal/PageList.zig index ebf1c7bec..e45f1d328 100644 --- a/src/terminal/PageList.zig +++ b/src/terminal/PageList.zig @@ -1561,9 +1561,9 @@ pub fn adjustCapacity( page: *List.Node, adjustment: AdjustCapacity, ) !*List.Node { - // We always use our base capacity which is our standard - // adjusted for our column size. - var cap = try std_capacity.adjust(.{ .cols = self.cols }); + // We always start with the base capacity of the existing page. This + // ensures we never shrink from what we need. + var cap = page.data.capacity; // From there, we increase our capacity as required if (adjustment.styles) |v| { @@ -1571,6 +1571,8 @@ pub fn adjustCapacity( cap.styles = @max(cap.styles, aligned); } + log.info("adjusting page capacity={}", .{cap}); + // Create our new page and clone the old page into it. const new_page = try self.createPage(cap); errdefer self.destroyPage(new_page);