summaryrefslogtreecommitdiff
path: root/core/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/panes.zig')
-rw-r--r--core/panes.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/panes.zig b/core/panes.zig
index fe127acd..280fd3f9 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -1487,8 +1487,11 @@ pub fn removePane(p: *Pardes, id: usize, to: ?usize) error{OutOfMemory}!void {
layout.compute(p);
};
// A held pane's reader is its tether: it closes with it (pick-ui
- // SPEC §11), its rows going where a closed pane's go.
- if (Trail.readerOf(p, pane)) |r| try p.removePane(r, null);
+ // SPEC §11), its rows going where a closed pane's go; one with changes
+ // it has not saved is held instead, as a step holds it (Trail.show).
+ if (Trail.readerOf(p, pane)) |r| {
+ if (tagline.dirty(p.panes[r].?)) Trail.keep(p.panes[r].?) else try p.removePane(r, null);
+ }
// A docked pane's rows go back to its owner and nobody else.
const owner = layout.ownerOf(p, id);
const place = layout.findPane(p, id);