diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 14:20:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 25c847e28ae77f5c648d423d64011736f55eda4a (patch) | |
| tree | 38a2e3694a1c4db8ee0f6acebb420109e00d020a /src/layout.zig | |
| parent | b7d3c0c1d9b2ba4e5181e56f15015dd9c996c5a8 (diff) | |
| download | pardes-25c847e28ae77f5c648d423d64011736f55eda4a.tar.gz pardes-25c847e28ae77f5c648d423d64011736f55eda4a.zip | |
Delcol on the last column leaves the window, empty but for its workspace tag, as acme's does
The last column's Delcol ended the session. The window now stays, with only the workspace tag; Newcol, and New (which makes the column it goes in), start it again. A word run with no pane at all runs with a stand-in that is no pane, the root ctl takes session words, and pane/new makes its scratch in the session's directory.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/layout.zig')
| -rw-r--r-- | src/layout.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/layout.zig b/src/layout.zig index 16af1ec5..28f567bc 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -635,6 +635,19 @@ fn canSplitCol(p: *Pardes, col: usize) bool { /// An empty column beside column `col`, with half its width: acme's Newcol /// (rowadd, rows.c:51). The new column's index, or null with no room. +/// A window with no column left (Delcol took the last, as acme lets it): +/// its first one, empty; null when it has columns. +pub fn firstColumn(p: *Pardes) ?usize { + if (p.ncol != 0) return null; + p.col_weight[0] = 2; + p.col_tags[0] = .{ .what = .column, .gpa = p.gpa }; + p.col_serial[0] = 0; + p.col_n[0] = 0; + p.ncol = 1; + noteColumn(p, "newcol", columnSerial(p, 0)); + return 0; +} + pub fn insertColumn(p: *Pardes, col: usize, before: bool) ?usize { if (!canSplitCol(p, col)) return null; var old_weight = p.col_weight[col]; |
