summaryrefslogtreecommitdiff
path: root/src/Finder.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:51:03 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:00:59 -0300
commit7e4e9f23978ba6c1313415c12064c9267ebbe7f2 (patch)
tree1f879e16c00a49aa948142a01610c091fa241390 /src/Finder.zig
parent5d39c627bc3136dca1fc6ac6593bd4e4e34d9185 (diff)
downloadpardes-7e4e9f23978ba6c1313415c12064c9267ebbe7f2.tar.gz
pardes-7e4e9f23978ba6c1313415c12064c9267ebbe7f2.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Finder.zig')
-rw-r--r--src/Finder.zig12
1 files changed, 4 insertions, 8 deletions
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;
}