diff options
Diffstat (limited to 'core/Trail.zig')
| -rw-r--r-- | core/Trail.zig | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/Trail.zig b/core/Trail.zig index c6af03e5..b6d6341a 100644 --- a/core/Trail.zig +++ b/core/Trail.zig @@ -196,6 +196,7 @@ fn show(p: *Pardes, id: usize, path: []const u8, at: Spot) !usize { if (pane.file) |f| if (std.mem.eql(u8, f.path, path)) { look.clearNavigationSelection(p, pane); look.focusPaneLine(p, id, at, .center); + lift(p, id); return id; }; const free = p.freeSlot() orelse return error.NoPaneSlots; @@ -212,7 +213,7 @@ fn show(p: *Pardes, id: usize, path: []const u8, at: Spot) !usize { try panes.deinitPane(p, pane); layout.replacePane(p, id, free); p.panes[id] = null; - layout.compute(p); + lift(p, free); look.focusPaneLine(p, free, at, .keep); // Its line half the body's rows down, as a look's new pane has it. const rows = @max(1, p.view().rects[free].h -| pardes.BOX_H); @@ -220,6 +221,17 @@ fn show(p: *Pardes, id: usize, path: []const u8, at: Spot) !usize { return free; } +/// Pane `id`'s tag after a step may take more rows than it had (its walk's +/// words, a longer name): it is given them from its column, as a step that +/// wraps tags gives them (layout.restoreMinimaFrom), the others keeping +/// their own minimum. +fn lift(p: *Pardes, id: usize) void { + const now = p.view().rects; + var floor = layout.minima(p); + floor[id] = 0; + layout.restoreMinimaFrom(p, &now, &floor); +} + /// Pane `id` held (ยง6.5): Keep, or an edit. It no longer walks, so the /// walk leaves its trail (places, lists, its owner, forward steps); words /// about its own text (a search, a recipe) stay. The next jump from its |
