From dc4dd3bc25b11721ab3ad3fccbaea1de54b9fb90 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 22:52:51 -0300 Subject: A file whose disk text is what its unsaved pane was read or saved as is no change on disk: an Undo back across Get file or Edit's e to unsaved edits no longer says the file changed, and Save writes it Co-Authored-By: Claude Opus 5.5 --- src/File.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/File.zig') diff --git a/src/File.zig b/src/File.zig index 0d62e09b..875d0f46 100644 --- a/src/File.zig +++ b/src/File.zig @@ -1538,6 +1538,9 @@ pub fn changed(p: *Pardes, id: u8, bytes: []const u8) void { if (std.mem.eql(u8, f.content, bytes)) return; if (f.saved_hash) |saved| if (f.revision != f.saved_revision and std.hash.Wyhash.hash(0, f.content) != saved) { const disk = std.hash.Wyhash.hash(0, bytes); + // The disk holds what the text was read or saved as: no news, only + // a watch looking again (an undo back to this name, a restart). + if (disk == saved) return; if (f.disk_newer == disk) return; f.disk_newer = disk; f.disk_newer_warned = false; -- cgit v1.3