From 75e4787be773c8cbfd2e60e59d409b9556898365 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 15:58:05 -0300 Subject: kinds #35, the core's seam for ABI 3 (Kind.zig): each pane of a kind with view told each open view's facts by id when they change (the slot's view table, a hash a view, a stopped view told cols 0, and a step woken for a view a frame's layout changed) and ticked after, the tick's pa_tick and its prefix (placed and retag gone: the art words go on every pane of a PA_PICTURES kind from the first frame, the same bytes whichever view's step lays the tag out, by the session's first view, which was the 30 ms soak's rollbacks), found's rows the search's or appended to its +Search after, cancel's tokens dropped on every core (on the tape), a picture over PA_RASTER_MAX dropped and said once, a record of at most PA_RECORD_MAX, a Debug call over 16 ms of the kind's own (its allocations and job copies the core's) said once a site and failing --addon-test (which gains view N on|off and prints the tag the core makes), and the record ยง17.5's: a Restore, an Addon load and a reload read the pane's file as a Look does, a file not there a placeholder saying is not here, record kept, opened by the next Look or watch of it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Addon.zig | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/Addon.zig') diff --git a/src/Addon.zig b/src/Addon.zig index 5219f2b1..030da7d4 100644 --- a/src/Addon.zig +++ b/src/Addon.zig @@ -351,11 +351,10 @@ pub fn loadedOf(ops: *const Kind.Ops, path: []const u8, hash: [32]u8, words: *[6 .ops = @intFromPtr(ops), .caps = .{ .tick = ops.tick != null, .key = ops.key != null, .mouse = ops.mouse != null, .ctl = ops.ctl != null, .jobs = ops.job_run != null, .load = ops.load != null, - // 2.1's: a library of 2.0 has no `search` to read, and Esc leaves it. - .search = h.abi & 0xffff >= 1 and ops.search != null, - .esc = h.abi & 0xffff >= 1 and ops.key != null, + .search = ops.search != null, .address = ops.address != null, - .v22 = h.abi & 0xffff >= 2, + .view = ops.view != null, + .pictures = h.flags & Kind.c.PA_PICTURES != 0, }, }; } @@ -560,13 +559,12 @@ pub fn landed(p: *Pardes, op: Op, pane: u8, l: Loaded) void { /// The panes of kind `name` that waited for it (placeholders), opened. pub fn reopenWaiting(p: *Pardes, name: []const u8) usize { - const k = p.kinds.byName(name) orelse return 0; + if (p.kinds.byName(name) == null) return 0; var n: usize = 0; + // Each from its file, as a Restore's (a file not here: it waits on). for (p.panes, 0..) |slot, id| if (slot) |pane| if (pane.addon) |s| if (!s.live and s.is(name)) { - s.ops = p.kinds.ops[k]; - s.gen = p.kinds.kinds[k].gen; - s.refused = .{}; - if (Kind.reopen(p, id, s, null)) n += 1; + dump.reviveSlot(p, id, s); + n += @intFromBool(s.live); }; return n; } @@ -607,7 +605,10 @@ fn swap(p: *Pardes, l: Loaded, why: *Why) bool { n.where_text.set(Kind.where(s, &place)); if (o.dump != null and l.caps.load) n.record = dump.slotRecord(s) catch return fail(why, "out of memory", .{}); } - if (!Kind.reopen(p, id, n, null)) return fail(why, "refused: a pane of it would not open again: {s}", .{n.refused.slice()}); + // From its file as it is, the record its small state. + const bytes: ?[]u8 = if (new_ops != null and n.path.len > 0) @import("fs.zig").read(p, n.path) catch null else null; + defer if (bytes) |b| p.gpa.free(b); + if (!Kind.reopen(p, id, n, bytes)) return fail(why, "refused: a pane of it would not open again: {s}", .{n.refused.slice()}); }; // Every pane opened: the old states go, the new take their slots. for (p.panes, 0..) |pslot, id| if (pslot) |pane| if (pane.addon) |s| if (fresh[id]) |n| { -- cgit v1.3