diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 22:52:51 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 23:22:39 -0300 |
| commit | dc4dd3bc25b11721ab3ad3fccbaea1de54b9fb90 (patch) | |
| tree | e2a58d941ca91fcd79541b89cfac11791c0aa12e /src/File.zig | |
| parent | 3ddd34bcd94ba95d9cacbf6afcb9f89a16a414ce (diff) | |
| download | pardes-dc4dd3bc25b11721ab3ad3fccbaea1de54b9fb90.tar.gz pardes-dc4dd3bc25b11721ab3ad3fccbaea1de54b9fb90.zip | |
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 <[email protected]>
Diffstat (limited to 'src/File.zig')
| -rw-r--r-- | src/File.zig | 3 |
1 files changed, 3 insertions, 0 deletions
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; |
