summaryrefslogtreecommitdiff
path: root/test/kitty.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 02:56:53 -0300
committerGabriel Schneider <[email protected]>2026-11-06 04:13:33 -0300
commitd1d5d3cfb18841604bba2057eeb3598f729b4475 (patch)
tree298c29ab8767852bf74eb86ad4d15acc4348f109 /test/kitty.zig
parent33037ece5af9ae1c7048819bbbae3fc5e6fc4ade (diff)
downloadpardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.tar.gz
pardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/kitty.zig')
-rw-r--r--test/kitty.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/kitty.zig b/test/kitty.zig
index f222f9cf..70e20139 100644
--- a/test/kitty.zig
+++ b/test/kitty.zig
@@ -71,7 +71,7 @@ const Rig = struct {
std.testing.log_level = .err;
// A core boots one shell or the classic three.
const p = try Pardes.init(gpa, .{ .cols = 120, .rows = 40, .shells = if (shells > 1) 3 else 1 });
- p.frontend.native_images = true;
+ p.view().frontend.native_images = true;
p.update(.{ .resize = .{ .cols = 120, .rows = 40, .cell_pixels = .{ .w = 10, .h = 20 } } });
for (p.panes) |slot| if (slot) |each| {
each.body.mode = .tty;
@@ -141,7 +141,7 @@ const Rig = struct {
/// The top-left cell of pane `id`'s body, in screen cells.
fn origin(r: *Rig, id: u8) struct { x: u16, y: u16 } {
- const rect = r.p.rects[id];
+ const rect = r.p.view().rects[id];
return .{ .x = rect.x + config.GUTTER, .y = r.p.bodyTop(r.pane(id), rect) };
}
@@ -1200,7 +1200,7 @@ test "kitty: an image wider than its pane is cut at the pane's edge, never drawn
var r = try Rig.init(3);
defer r.deinit();
// The classic boot: two columns. Pane 0 is in the left one.
- const rect = r.p.rects[0];
+ const rect = r.p.view().rects[0];
const o = r.origin(0);
const right = rect.x + rect.w;
// 2x1 cells at its last-but-one column: one cell is the pane's.
@@ -1319,7 +1319,7 @@ test "kitty: under a shell that draws no pixels, a 64x64 image over 8x4 cells is
// The glyph art a tty draws there is the tty's test (tui.zig).
var r = try Rig.init(1);
defer r.deinit();
- r.p.frontend.native_images = false;
+ r.p.view().frontend.native_images = false;
r.p.update(.{ .resize = .{ .cols = 120, .rows = 40, .cell_pixels = .{ .w = 8, .h = 16 } } });
r.drain();
// Not the frame's arena: each frame resets that.