summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 19:53:53 -0300
committerGabriel Schneider <[email protected]>2026-11-05 22:03:21 -0300
commit12cb0a704075dea2512f77582635376fe967dee6 (patch)
tree0f498bf581e3f8ece31f8a5eaa06accba7aa7415 /src/panes.zig
parent1a1ce29051ea6aa3be4754074f6a00b905d6b208 (diff)
downloadpardes-12cb0a704075dea2512f77582635376fe967dee6.tar.gz
pardes-12cb0a704075dea2512f77582635376fe967dee6.zip
split pardes.zig by noun, layout: the session's columns and the rows its chrome takes move into src/layout.zig: newColumn, setActiveColumn, activeColumn, noteTyped, newScratchIn, keyboardColumn, removeColumn, besideColumn, topBarHeight, columnBarHeight, wantedTagRows, bodyTop, tagTop, tagCapacity and reprojectTagHit; the session keeps four as declaration aliases (topBarHeight and bodyTop, called from everywhere; tagTop and setActiveColumn, which Store.zig and Handover.zig call, so the persistence agent's files are untouched), the rest are layout.x(p, ...) in their callers (draw.zig, mouse.zig, ninep/cols.zig, tagline.zig and seven more; gui.zig, whose locals are named layout, through pardes.layout); layout's own placement helper bodyTop, a pane's top past its tag as heights go, is bodyFrom now, the name going to the session's; tests moved with them, by name: a new column takes width only from the column that created it; Newcol refuses an unsplittable restored weight before spawning; repeated non-dyadic column splits preserve every unrelated boundary; dragging a column's only pane to another leaves that column in place, empty; tiny screens keep pane space before adding a column tag; a pure move, no field touched, a dump and the wire as they were; gates: tui core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok, gui unit-test 1518/1519 (1 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/panes.zig b/src/panes.zig
index 8786de2b..94c9615f 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -1032,7 +1032,7 @@ pub fn removePane(p: *Pardes, id: usize, to: ?usize) error{OutOfMemory}!void {
// Before anything is torn down, so a failure here changes nothing.
try deinitPane(p, pane);
const gainer = layout.absorbVWeight(p, id, owner orelse to);
- const beside = if (emptied) |c| p.besideColumn(c, p.rects[id]) else null;
+ const beside = if (emptied) |c| layout.besideColumn(p, c, p.rects[id]) else null;
layout.removePane(p, id);
p.panes[id] = null;
if (kept) |k| p.store.close(p, k, gainer);
@@ -1260,14 +1260,14 @@ test "owned cwd column close allocates every copy before removing any pane" {
const columns = p.col_panes;
const counts = p.col_n;
allocator.fail_index = allocator.alloc_index + 1;
- try std.testing.expectError(error.OutOfMemory, p.removeColumn(0));
+ try std.testing.expectError(error.OutOfMemory, layout.removeColumn(p, 0));
for (before, p.panes) |old, current| try std.testing.expectEqual(old, current);
try std.testing.expectEqualDeep(columns, p.col_panes);
try std.testing.expectEqualDeep(counts, p.col_n);
try std.testing.expectEqual(@as(usize, 0), p.effects_len);
try std.testing.expect(first_child.cwd == .inherited and second_child.cwd == .inherited);
allocator.fail_index = std.math.maxInt(usize);
- try p.removeColumn(0);
+ try layout.removeColumn(p, 0);
try std.testing.expect(p.panes[0] == null and p.panes[1] == null);
p.sync();
p.sync();