summaryrefslogtreecommitdiff
path: root/src/Addon.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 15:58:05 -0300
committerGabriel Schneider <[email protected]>2026-11-06 17:53:43 -0300
commit75e4787be773c8cbfd2e60e59d409b9556898365 (patch)
tree7426b4184644e794c2abb2d7012461270b3ee43f /src/Addon.zig
parent31c77aa3f259e99a9723e188b77b651e5cd31621 (diff)
downloadpardes-75e4787be773c8cbfd2e60e59d409b9556898365.tar.gz
pardes-75e4787be773c8cbfd2e60e59d409b9556898365.zip
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 <path> is not here, record kept, opened by the next Look or watch of it
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Addon.zig')
-rw-r--r--src/Addon.zig21
1 files changed, 11 insertions, 10 deletions
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| {