From d1d5d3cfb18841604bba2057eeb3598f729b4475 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 02:56:53 -0300 Subject: client #1, the views indexed: a view's share of the session is Pardes.View (the ~42 fields views.fields named: size, cell metrics, columns, rects, focus, jumps, pointer, gestures, prefixes, frontend), one of Pardes.views[4] (null when closed), the live one views[live] through Pardes.view() (index field `view` renamed `live`); going into another view is the index plus the panes' shares, which stay swapped (park and unpark now move only Pane.pv); views.zig loses fields, Part over Pardes, Parked, kept, emptied and the session half of every copy, and a pane closing leaves every view's layout at once (views.gone, at the two places a slot is freed) instead of the serials each parked view kept; drawOne and within put the drawn view's own share back whole; the views are in the digest now (tape's per-field parts name views[k].field), so a fresh view's col_x/col_w default to zeros, not undefined; the dump keeps every open view in the core and the panes' shares of the others under `shares`; an image from before (live view as the core's own fields, the rest under `views`) loads them into views[] once; the ~2,400 references rewritten mechanically from the compiler's errors (p.active is p.view().active, `const v = p.view()` hoisted in 823 places), Kind.zig (4 lines) and addon_test.zig (3) among them, macos.zig by pattern (not compiled here); tape's watched host writes read the live view's frontend and active; perf.zig's accessor lines change its harness hash, the debug baselines re-keyed to it (their numbers the base's); no golden changes; gates: core-test 956/956 both, unit-test 1487/1488 tui and 1530/1531 gui, behaviour-test 248/248 both, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed tui, replicas ok Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Pipe.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Pipe.zig') diff --git a/src/Pipe.zig b/src/Pipe.zig index b7310e5c..e7895c0d 100644 --- a/src/Pipe.zig +++ b/src/Pipe.zig @@ -179,14 +179,14 @@ fn pipeFailed(p: *Pardes, wait: *const PendingPipe, failure: ?selection_pipe.Fai w.print("selection {d} of {d}: ", .{ fail.index + 1, wait.inputs.len }) catch return; writeFailure(w, failure) catch return; const content = out.toOwnedSlice() catch return; - const was = p.active; + const was = p.view().active; panes.Output.openErrors(p, wait.pane, content) catch |err| { p.gpa.free(content); // Nowhere to put the report is itself worth one line. p.reportError(wait.pane, "pipe", err); return; }; - if (p.panes[was] != null) p.active = was; + if (p.panes[was] != null) p.view().active = was; } /// How a filter failed, a line, and the command's stderr after it: what @@ -263,7 +263,7 @@ pub fn pipeResponse( const t: *Text = switch (wait.what) { .body => &pane.body, .tag => &pane.tag, - .column => if (wait.column < p.ncol) &p.col_tags[wait.column] else return, + .column => if (wait.column < p.view().ncol) &p.view().col_tags[wait.column] else return, .workspace => &p.global_tag, .input => return, }; @@ -572,7 +572,7 @@ test "a failed filter opens an errors buffer carrying the command's own words" { try std.testing.expectEqualSlices(u8, "abc\n", pane.file.?.content); try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.journal.done); // ...and the cursor did not go anywhere, so `|` again edits the same file. - try std.testing.expectEqual(@as(usize, 0), p.active); + try std.testing.expectEqual(@as(usize, 0), p.view().active); var found: ?[]const u8 = null; for (p.panes) |slot| { -- cgit v1.3