summaryrefslogtreecommitdiff
path: root/src/Store.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Store.zig')
-rw-r--r--src/Store.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Store.zig b/src/Store.zig
index e06c55e5..5e47d695 100644
--- a/src/Store.zig
+++ b/src/Store.zig
@@ -93,6 +93,9 @@ loaded: bool = false,
pending: std.ArrayList(u8) = .empty,
/// This session's closed panes, oldest first.
closed: std.ArrayList(Closed) = .empty,
+/// The panes closing now went to another window (Handover.finish): open
+/// there, they are no closed panes of this session, so none is kept.
+away: bool = false,
fn clockNs() i128 {
var ts: std.c.timespec = .{ .sec = 0, .nsec = 0 };
@@ -488,10 +491,10 @@ fn frame(gpa: std.mem.Allocator, out: *std.ArrayList(u8), kind: u8, parts: []con
/// Pane `id`, about to close, kept as a record: what it was (a one-pane
/// Dump) and where (its column, its rows, what it was attached to). Null
/// for a pane that is no pane of the user's: a query pane, a preview, one
-/// made and refused in the same step (never announced), or one whose dump
-/// fails or is too big. `close` finishes it once its rows have gone.
+/// carried to another window (`away`), one made and refused in the same
+/// step (never announced), or one whose dump fails or is too big. `close` finishes it once its rows have gone.
pub fn keep(s: *Store, p: *Pardes, id: usize) ?Kept {
- _ = s;
+ if (s.away) return null;
const pane = p.panes[id] orelse return null;
if (pane.fs.unannounced or pane.query != null) return null;
if (pane.file) |f| if (f.output) |o| if (o.from == .preview) return null;