From 6c82d06cd2a15d724b8e82e1128fa15dc9e35d05 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 07:56:48 -0300 Subject: Restore reads a clean file from disk, and an unsaved one whose file changed since the Dump is said changed, its first Save asking before overwriting it A Restore put back the dump's copy of every file pane and armed the watch with the disk as it now was, so a file changed on disk after the Dump came back as its old text, marked clean, and the next Save wrote the old text over the new without a word. A clean file pane's text is now not in the dump: Restore reads its file (an older dump's copy is read past too, and used only when the file is gone). An unsaved pane keeps its text once, base64, the plain copy beside it dropped, with the hash of the file it was read against (`disk_hash`); a Restore that finds another there says the file changed on disk, and Save asks once before overwriting it, as for a change seen while it was open. file_watch.zig's own tests were never collected (no test root imported it): main.zig's test block does now, and the restored watch test says what a clean restore now reads. Co-Authored-By: Claude Opus 5.5 --- test/fs_namespace.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig index bd620c2d..5bce9eda 100644 --- a/test/fs_namespace.zig +++ b/test/fs_namespace.zig @@ -206,7 +206,8 @@ test "explicit OS file opens and restores keep their names and request watches" .kind = .file, .tag = path, .body = "", - .file = .{ .path = path, .content = "const unsaved = 2;\n" }, + // Unsaved text: kept (a clean pane's is read from disk). + .file = .{ .path = path, .content = "const unsaved = 2;\n", .dirty = true }, }); try std.testing.expectEqualStrings(path, copy.file.?.path); try std.testing.expectEqualStrings("const unsaved = 2;\n", copy.file.?.content); -- cgit v1.3