summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dump.zig b/src/dump.zig
index ca3751f2..1420ea8f 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -208,9 +208,16 @@ pub const LocationRow = struct {
pub const File = struct {
path: []const u8 = "",
+ /// The text, in older dumps plain and base64 both; now base64 alone,
+ /// and only for a pane whose text is not its file's on disk (unsaved,
+ /// an output, a file never written): a clean file's is read from disk.
content: []const u8 = "",
content_b64: []const u8 = "",
dirty: bool = false,
+ /// An unsaved pane's: the hash of the file on disk its text was read
+ /// against. A Restore that finds another there says it changed, and
+ /// Save asks before overwriting it.
+ disk_hash: ?u64 = null,
/// Its file was on disk when dumped: one gone by the Restore is said
/// deleted, one never written (Config's new file) is not. True in
/// older dumps.
@@ -728,6 +735,7 @@ pub fn dumpState(p: *Pardes) !void {
const body = try body_layer.bodyText(p, arena, pane);
const scroll: usize = @intCast(@max(0, pane.scroll()));
var dp: Pane = if (pane.file) |*f| try pardes.panes.File.dumpPane(
+ p,
arena,
pane,
f,