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/Finder.zig | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/Finder.zig') diff --git a/src/Finder.zig b/src/Finder.zig index 0be40c24..3744e5d1 100644 --- a/src/Finder.zig +++ b/src/Finder.zig @@ -84,17 +84,13 @@ fn open(f: *Finder, p: *Pardes) ?usize { p.col_serial[c] = 0; p.ncol += 1; f.serial = layout.columnSerial(p, c); - // A narrower column wraps long tags onto more rows: those rows back - // from the panes with rows to spare, shared out again only where that - // is not enough, and where nothing holds every minimum there is no - // finder, as Newcol is refused. - layout.restoreMinimaFrom(p, &before, &before_min); - for (0..p.ncol) |k| if (k != c and layout.squeezed(p, k, &before, &before_min) and !layout.shareColumn(p, k)) { - layout.dropColumnUnannounced(p, c); + // Where nothing holds every minimum there is no finder, as Newcol is + // refused. + if (!layout.keepColumn(p, c, &before, &before_min)) { f.serial = 0; layout.compute(p); return null; - }; + } layout.noteColumn(p, "newcol", f.serial); return c; } -- cgit v1.3