summaryrefslogtreecommitdiff
path: root/src/pardes.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/pardes.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/pardes.zig')
-rw-r--r--src/pardes.zig12
1 files changed, 2 insertions, 10 deletions
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);