summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 19:16:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit3189900c13b98298776d0da8dcbcb4e0d88858cf (patch)
treea4bc0687586a108efe655c9dc9d255ef15260fa6 /src/builtins.zig
parent9a256d34ebca317e3007adf71c2b94016059d4a3 (diff)
downloadpardes-3189900c13b98298776d0da8dcbcb4e0d88858cf.tar.gz
pardes-3189900c13b98298776d0da8dcbcb4e0d88858cf.zip
Joincol is refused, as Newcol is, when the joined column cannot give each pane its tag and 2 rows
Joincol moved every pane of the keyboard's column into the next one whether they fit or not. Two columns of two panes in a 12-row window became one column of four, wanting 12 rows where 10 were free, a layout that `size` then refused as it stood. Joincol now tries the join in place first (layout.joinFits: the panes and width moved, minimaFit asked, everything put back, nothing dropped or logged). A join that does not fit is refused, "Joincol: no space: the joined column cannot give each pane its tag and 2 rows". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 6688d05f..27a1d36d 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1271,6 +1271,9 @@ pub const Joincol = struct {
// The keyboard's column joins the one to its right; the last has none.
const col = c.p.keyboardColumn(c.p.active) orelse return;
if (col + 1 >= c.p.ncol) return c.p.reportFailure(c.id, "Joincol: no column to the right");
+ // As Newcol is refused: a column that could not give each pane its
+ // tag and 2 rows would leave a layout `size` refuses as it is.
+ if (!layout.joinFits(c.p, col)) return c.p.reportFailure(c.id, "Joincol: no space: the joined column cannot give each pane its tag and 2 rows");
layout.joinCol(c.p, col);
}
};