From f207f1d4d56d1012766e6206e713f2b3da70579d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 10:11:14 -0300 Subject: A column takes panes until their minimums fill it, not until none can be halved Placement halved the tallest pane or refused, so 11 panes filled 48 rows that hold 16 at their tag and two rows each: the refusal did not match the documented arithmetic. When no pane can be halved but the minimums with the new pane's fit, the column's rows are shared out again; and a refused pane's removal leaves no pane under its minimum. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 225dbf9e..f7aee16c 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -6630,10 +6630,16 @@ pub const Pardes = struct { } pub fn sync(p: *Pardes) void { + var refused = false; while (p.unplaced.findFirstSet()) |id| { p.unplaced.unset(id); if (p.panes[id] != null) p.removePane(id, null) catch {}; + refused = true; } + // A refused pane gone, no pane it squeezed stays under its minimum. + if (refused) for (0..p.ncol) |c| if (!layout.columnAtMinimums(p, c)) { + _ = layout.shareColumn(p, c); + }; tagline.flattenHeaders(p); if (p.header_column != null and p.columnBarHeight() == 0) { tagline.exitHeader(p); -- cgit v1.3