diff options
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/replica.zig b/src/replica.zig index fa888021..f84e61e8 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -425,7 +425,8 @@ pub const Screens = struct { fn each(x: Ctx, p: *Pardes) anyerror!void { var arena: std.heap.ArenaAllocator = .init(x.s.gpa); defer arena.deinit(); - for (p.panes, 0..) |slot, id| if (slot) |pane| if (pane.addon) |k| if (k.ops != null and !pane.collapsed) { + // A plain kind's is drawn where it is shown (Kind.runsHere). + for (p.panes, 0..) |slot, id| if (slot) |pane| if (pane.addon) |k| if (k.ops != null and k.plain == null and !pane.collapsed) { const pp = &x.s.peers.items[x.peer][id]; if (pp.shadow.serial != pane.serial) { pp.shadow.deinit(x.s.gpa); @@ -761,8 +762,13 @@ pub const Replica = struct { const c = try pardes.dump.load(epoch, o, bytes, null); // The chrome's colours are local, never dumped: the restored theme's. pardes.colors.finishThemeInitialization(c); - // It runs no kind's code: its panes of a kind are Shadows. - c.kinds.ops = @splat(null); + // It runs a plain kind's code of its own (Addon.plainOps), each pane + // of one opened here from its record; another's panes are Shadows. + for (c.kinds.kinds[0..c.kinds.n], c.kinds.ops[0..c.kinds.n]) |*e, *ops| ops.* = pardes.Addon.plainOps(e); + @memset(c.kinds.ops[c.kinds.n..], null); + for (c.panes, 0..) |pslot, at| if (pslot) |pane| if (pane.addon) |s| if (c.kinds.byName(s.nameOf())) |k| if (c.kinds.ops[k]) |ops| { + pane.addon = try pardes.dump.plainHere(c, at, s, ops); + }; // What loading queued (a watch, a theme asked for) is the // authority's errand, done there already: the session was dumped // between steps, with nothing queued. |
