From 79b7505cba89a97153e2cfa2a3fef69bb4792faf Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 13:47:11 -0300 Subject: A Restore's warning about unsaved text no longer lets the next Exit discard it Exit and Restore shared one warned-at revision, so a Restore a script was refused over ctl spent the warning, and the person's next Exit quit without asking, throwing the text away. The warning now records which word gave it, and only that word goes ahead on it. Co-Authored-By: Claude Opus 5.5 --- src/panes.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/panes.zig') diff --git a/src/panes.zig b/src/panes.zig index 888465f7..09b93aa3 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -24,6 +24,9 @@ const Key = pardes.Key; pub const EditText = struct { text: []u8, row0: i32 }; pub const Pane = struct { + /// The words that throw unsaved text away (builtins.zig warnModified). + pub const Discarding = enum { Exit, Restore }; + /// One mouse selection (block-shaped), per button. c/r are text-area relative; /// r counts from the tag's first row (the body starts at Pane.tag_rows). pub const Sel = struct { @@ -100,8 +103,9 @@ pub const Pane = struct { /// the shell's command count its start (C mark) reaches. sent_command: ?struct { word: [64]u8 = undefined, len: u8 = 0, seq: u32 = 0 } = null, /// The revision an Exit or a Restore last warned this pane was modified - /// at (builtins.zig warnModified). - discard_warned: ?u32 = null, + /// at, and which of them: only that word goes ahead on the warning + /// (builtins.zig warnModified). + discard_warned: ?struct { revision: u32, by: Discarding } = null, /// Native host queues the Linux v9fs launcher in this pane's initial shell. v9fs_on_spawn: bool = false, file: ?File.State = null, -- cgit v1.3