summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 13:47:11 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit79b7505cba89a97153e2cfa2a3fef69bb4792faf (patch)
treed47f23e5167c320d2f29c36c7175e50c2218fe5f /src/panes.zig
parent627d4fba9cc958b1c07c6f050825658e567ea4de (diff)
downloadpardes-79b7505cba89a97153e2cfa2a3fef69bb4792faf.tar.gz
pardes-79b7505cba89a97153e2cfa2a3fef69bb4792faf.zip
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 <[email protected]>
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig8
1 files changed, 6 insertions, 2 deletions
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,