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, 7 insertions, 0 deletions
diff --git a/core/panes.zig b/core/panes.zig
index 20feb0b3..115323c4 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -15,6 +15,7 @@ const dump = @import("dump.zig");
const memory = @import("memory.zig");
const ctlfs = @import("ninep/tree.zig");
const Pipe = @import("Pipe.zig");
+const Trail = @import("Trail.zig");
const Key = pardes.Key;
const Cell = pardes.Cell;
const BOX_H = pardes.BOX_H;
@@ -269,6 +270,9 @@ pub const Pane = struct {
/// the current one selected (Places.zig).
places: Places = .{},
look_at: ?LookSpot = null,
+ /// Its walk: the places it stepped through, its owner when it is a
+ /// reader, whether it is held (Trail.zig, pick-ui SPEC §6).
+ trail: Trail = .{},
/// `gw`'s words, labelled in order while it waits for a label to be
/// typed (gpa-owned); `jump_first` is the label's first letter once typed.
jump: std.ArrayList(modal.Selection) = .empty,
@@ -1508,6 +1512,9 @@ pub fn removePane(p: *Pardes, id: usize, to: ?usize) error{OutOfMemory}!void {
try p.removePane(k, id);
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);
// 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);