summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 19:23:32 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit576cee8a444d07a050df433f043367ca57fe36c4 (patch)
tree37c4ebee644f0c0de2aa4688e4fdd4786fdd8d6b /src/pardes.zig
parenta15c05b3d15bc269b3aec195c5e813a0f0203d4f (diff)
downloadpardes-576cee8a444d07a050df433f043367ca57fe36c4.tar.gz
pardes-576cee8a444d07a050df433f043367ca57fe36c4.zip
Newcol shares a column's rows out again when its narrower tags would leave a pane under its tag and two rows, or is refused
A seeded sweep of placements (New, pane/new, Edit =, Tty, look, Delcol, deletes, refusals included) over screens 6 to 40 rows high found no refused placement that leaves a pane short since lyltlqnz and lrpzwyom; the pane a row short came from Newcol, which halves a column's width so long tags wrap onto more rows, raising those panes' minimums with no rows moved. Newcol now shares each such column's rows out again, and where a column has not the rows for every minimum there is no new column (Newcol: no space for a column: the panes' tags would not fit), as a size too small is refused. The sweep, 300 seeds, is the test; a user's drag or a tag grown by editing may still take a pane under, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 19fe51d1..22d5f7a1 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -5082,6 +5082,15 @@ 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: its column's rows are shared
+ // out again, and where they cannot hold every minimum there is no
+ // new column, as a size too small is refused.
+ for (0..p.ncol) |k| if (!layout.columnAtMinimums(p, k) and !layout.shareColumn(p, k)) {
+ layout.dropColumn(p, c);
+ layout.compute(p);
+ return p.reportFailure(from_id, "Newcol: no space for a column: the panes' tags would not fit");
+ };
tagline.enterHeader(p, c);
}