summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 12:28:22 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit54aaa0bce75e1f231d68647a9d7c0f052ed92f8e (patch)
tree62465fc3af0e97a921d3a3f8f7ef9f78702cdf5b /src/dump.zig
parentec89f340f239b31d6c9ef95e7e76696f9aa2005a (diff)
downloadpardes-54aaa0bce75e1f231d68647a9d7c0f052ed92f8e.tar.gz
pardes-54aaa0bce75e1f231d68647a9d7c0f052ed92f8e.zip
The workspace tag's Restore word names the last dump, and the dump a Restore came from
Once the workspace tag was edited, its own text kept the Restore <path> of the dump at that time, stale after the next Dump; and a Restore dropped the path altogether (the new session had no last dump). A new dump now swaps the old path in the tag's own text, and a Restore points the word at the dump it read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dump.zig b/src/dump.zig
index 4db3df24..0e911ec1 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -753,6 +753,7 @@ pub fn restore(p: *Pardes, zon_bytes: []const u8, from: []const u8) !*Pardes {
opts.rows = p.screen_h;
var old: OldSerials = .{};
const replacement = try initDump(p.gpa, opts, zon_bytes, p, &old);
+ replacement.pointRestoreAt(from);
pardes.ctlfs.events.notePath(replacement, "restore", from);
// Which serial each pane and column had, for a script that held them.
for (replacement.panes, old.panes) |slot, was| if (slot) |pane| if (was != 0) {
@@ -802,6 +803,8 @@ fn initDump(gpa: std.mem.Allocator, opts: Options, zon_bytes: []const u8, previo
p.cell_pixels = old.cell_pixels;
p.row_metrics = old.row_metrics;
p.native_images = old.native_images;
+ // The workspace tag's Restore word names the dump it came from.
+ if (old.last_dump) |d| p.last_dump = try gpa.dupe(u8, d);
// Recent goes on across a Restore, the old session's own list.
p.recent = old.recent.clone(p.recentGpa());
p.recent_loaded = old.recent_loaded;