summaryrefslogtreecommitdiff
path: root/src/detached/client.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 22:34:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit7ba54de4bd498c2a56ea3d0d43c88356759f7b1f (patch)
tree2e661d1785ef6e74c158ca6b2e1aa96b763ec7bc /src/detached/client.zig
parent52049344c1992850ea712e029eb5c4a88a7dfe19 (diff)
downloadpardes-7ba54de4bd498c2a56ea3d0d43c88356759f7b1f.tar.gz
pardes-7ba54de4bd498c2a56ea3d0d43c88356759f7b1f.zip
Move saving and loading a whole editor out of pardes.zig into dump.zig
Pure move, no behaviour change (acme keeps dump and load in rows.c): dumpState, restore, initFromDump and initDump go verbatim to the end of dump.zig, after the dump format they read and write. Inside dump.zig the moved code's `dump.` prefix drops, so `Pane` there is the dump record; the one editor pane it names is spelled `pardes.panes.Pane`, and its other `panes.X` references become `pardes.panes.X` because dump.zig's own tests use `panes` as a local name. The methods become free functions taking `p: *Pardes`: `p.dumpState()` becomes `dump.dumpState(p)`, `core.restore(bytes)` becomes `dump.restore(core, bytes)` and `Pardes.initFromDump(..)` becomes `dump.initFromDump(..)`, in pardes.zig, the shells, layout.zig, Terminal.zig, builtins.zig and the tests (38 receiver rewrites plus the initFromDump calls). The tag-tail restore helpers stay with the tag code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/detached/client.zig')
-rw-r--r--src/detached/client.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/detached/client.zig b/src/detached/client.zig
index a027c0bb..7cee790a 100644
--- a/src/detached/client.zig
+++ b/src/detached/client.zig
@@ -59,6 +59,7 @@
const std = @import("std");
const libc = std.c;
const pardes = @import("../pardes.zig");
+const dump = @import("../dump.zig");
const server = @import("server.zig");
const wire = @import("wire.zig");
@@ -842,7 +843,7 @@ test "detached Restore keeps attached frontends and follows queued frames with a
try testing.expectEqual(fd, h.session.clients[c.slot].fd);
try testing.expect(h.session.clients[c.slot].attached);
- try h.core.dumpState();
+ try dump.dumpState(h.core);
const saved = try testing.allocator.dupe(u8, h.core.dump_out.?);
defer testing.allocator.free(saved);
while (h.core.nextEffect()) |_| {}