From 7e4e9f23978ba6c1313415c12064c9267ebbe7f2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:51:03 -0300 Subject: layout.keepColumn: whether a new column may stay, its narrower neighbours' panes given back the rows their wrapped tags took or the column dropped, is one rule where Newcol and the finder each wrote the trial loop out; squeezed, which only that loop asked, is its body Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/pardes.zig | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index cd247272..e08c2f37 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4745,19 +4745,11 @@ pub const Pardes = struct { else "Newcol: no space for a column: this one is too narrow to split"); }; - // A narrower column wraps long tags onto more rows, which can leave - // a pane under its tag and two rows: it takes them back from the - // panes with rows to spare (a pane dragged short keeps its own), - // its column shared out again only where that is not enough, and - // where nothing holds every minimum there is no new column, as a - // size too small is refused. - layout.restoreMinimaFrom(p, &before, &before_min); - for (0..p.ncol) |k| if (layout.squeezed(p, k, &before, &before_min) and !layout.shareColumn(p, k)) { - layout.dropColumnUnannounced(p, c); + if (!layout.keepColumn(p, c, &before, &before_min)) { p.next_column_serial = unspent; layout.compute(p); return p.reportFailure(from_id, "Newcol: no space for a column: the panes' tags would not fit"); - }; + } // Kept: now it has a serial, and the log hears of it. layout.noteColumn(p, "newcol", layout.columnSerial(p, c)); tagline.enterHeader(p, c); -- cgit v1.3