diff options
Diffstat (limited to 'src/File.zig')
| -rw-r--r-- | src/File.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/File.zig b/src/File.zig index d41007c3..4fac0073 100644 --- a/src/File.zig +++ b/src/File.zig @@ -953,6 +953,16 @@ pub fn restore(p: *Pardes, id: usize, src: dump.Pane) !*Pane { if (std.hash.Wyhash.hash(0, bytes) != read_against) changed(p, @intCast(id), bytes); } else |_| {} }; + // An older dump says nothing of what the text was read against: its + // first Save asks, as for a file changed on disk, rather than guess. + if (saved.dirty and saved.disk_hash == null and output == null and onDisk(path)) { + if (filesystem.read(p, path)) |bytes| { + defer p.gpa.free(bytes); + const f = &pane.file.?; + f.disk_newer = std.hash.Wyhash.hash(0, bytes); + f.disk_newer_warned = false; + } else |_| {} + } return pane; } |
