From 54aaa0bce75e1f231d68647a9d7c0f052ed92f8e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 12:28:22 -0300 Subject: 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 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 --- src/dump.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dump.zig') 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; -- cgit v1.3