summaryrefslogtreecommitdiff
path: root/src/File.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/File.zig')
-rw-r--r--src/File.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/File.zig b/src/File.zig
index 6a1ac319..810bc766 100644
--- a/src/File.zig
+++ b/src/File.zig
@@ -809,6 +809,10 @@ pub fn restore(p: *Pardes, id: usize, src: dump.Pane) !*Pane {
.location_rows = location_rows,
.scroll = src.scroll,
.revision = @intFromBool(saved.dirty),
+ // Restored with unsaved text, it has text to lose as an edited pane
+ // has: a hash its text does not match, so Exit, Restore, Del and
+ // get ask first (builtins.warnModifiedIn reads only edited panes).
+ .saved_hash = if (saved.dirty) std.hash.Wyhash.hash(0, content) +% 1 else null,
.history = history,
};
pane.file.?.tree_context = saved.tree_context and supportsContext(pane);