From 50914b0e04ac0129b11bff0f0007d5cedbfc7f8d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 20:39:55 -0300 Subject: fields #37, a column is one Column: the four parallel arrays a column's own state was kept in (col_panes, col_n, col_weight, col_serial) are the session's cols: [MAX_COLS]Column, a struct of panes, n, weight and serial (acme's Column, cols.c), so a column shifted, saved or reset is one assignment where it was four (layout.reorderColumn, dropColumn, insertColumn, firstColumn, joinFits, Finder.open; joinFits and the resets now give back a column's panes beyond its count too, which nothing reads); its tag stays the session's col_tags, as a view opened takes the live one's columns but tags of its own (views.open), and col_x and col_w stay with the rects, worked out each sync; the uses in 20 files read p.cols[c].n for p.col_n[c] and so on, tests that compared the arrays whole compare the columns whole (or their weights, layout.zig's weightsOf); views.zig's per-view fields name cols; a dump written before this change loads its columns as the default once: an Upgrade or Restore from it comes back with its columns empty and its panes in none of them, and the wire's semantics change (the digest walks cols); dump.zig and Handover.zig, the persistence agent's, are edited only where they name these fields; gates on 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/ninep/tree.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ninep/tree.zig') diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index 8c0743bd..08db0d75 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -1832,7 +1832,7 @@ test "random placements, refused or not, leave no pane under its tag and two row } for (0..p.ncol) |c| if (!layout.columnAtMinimums(p, c)) { std.debug.print("seed {d} rows {d} step {d} action {d}: column {d} under its minimums\n", .{ seed, rows, step, action, c }); - for (p.col_panes[c][0..p.col_n[c]]) |id| std.debug.print(" pane {d} h {d} min {d}\n", .{ id, p.rects[id].h, layout.minRows(p, id) }); + for (p.cols[c].panes[0..p.cols[c].n]) |id| std.debug.print(" pane {d} h {d} min {d}\n", .{ id, p.rects[id].h, layout.minRows(p, id) }); return error.TestUnexpectedResult; }; } @@ -2052,8 +2052,8 @@ test "no placement leaves a pane shorter than its tag and two rows; a full colum var count: usize = 0; for (p.panes) |slot| count += @intFromBool(slot != null); try testing.expectEqual(made, count); // the refused one is gone - for (0..p.ncol) |c| for (p.col_panes[c][0..p.col_n[c]]) |k| { - if (p.col_n[c] > 1 and !p.panes[k].?.collapsed) + for (0..p.ncol) |c| for (p.cols[c].panes[0..p.cols[c].n]) |k| { + if (p.cols[c].n > 1 and !p.panes[k].?.collapsed) try testing.expect(p.rects[k].h >= p.panes[k].?.tag_rows + pardes.layout.min_body_rows); }; } @@ -2102,6 +2102,6 @@ test "a pane made from pane/new goes last in its column, even when the last pane for (0..3) |_| { const made = call(p, .{ .tag = 1, .op = .open, .node = @backingInt(TopFile.new) }).reply.handle; p.sync(); - try testing.expectEqual(made, p.panes[p.col_panes[0][p.col_n[0] - 1]].?.serial); + try testing.expectEqual(made, p.panes[p.cols[0].panes[p.cols[0].n - 1]].?.serial); } } -- cgit v1.3