summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Band.zig2
-rw-r--r--core/layout.zig9
2 files changed, 8 insertions, 3 deletions
diff --git a/core/Band.zig b/core/Band.zig
index cdeaf19b..7d874319 100644
--- a/core/Band.zig
+++ b/core/Band.zig
@@ -589,6 +589,8 @@ pub fn line(band: *const Band, arena: std.mem.Allocator, tab: u16, y: u16) !Line
/// place of the path while the band shows. Worked out from the state as
/// the frame's band is, in a room of its own on the stack.
pub fn docLeft(p: *Pardes, buf: []u8) ?[]const u8 {
+ // A picker's steps are lists, never a doc: no band made twice a frame.
+ if (p.view().tag_state.kind == .pick) return null;
const id = TagState.hostOf(p) orelse return null;
const pane = p.panes[id] orelse return null;
if (takes(p, id) == 0) return null;
diff --git a/core/layout.zig b/core/layout.zig
index 2a5d2cf3..9c15833d 100644
--- a/core/layout.zig
+++ b/core/layout.zig
@@ -1514,14 +1514,17 @@ fn floorRows(p: *Pardes, id: usize) u16 {
/// the column has not the rows, the terminal keeps what it could get.
// ponytail: a row per step, O(panes x rows); a column holds few of both.
fn keepTerminalFloors(p: *Pardes, c: usize, hs: []u16) void {
+ // Each pane's floor once a pass: a band's wraps its tag twice
+ // (floorRows), and nothing here moves it.
+ var floors: [MAX_PANES]u16 = undefined;
+ for (floors[0..hs.len], 0..) |*floor, k| floor.* = floorRows(p, p.view().cols[c].panes[k]);
for (hs, 0..) |*h, k| {
- const floor = floorRows(p, p.view().cols[c].panes[k]);
- while (h.* < floor) {
+ while (h.* < floors[k]) {
var giver: ?usize = null;
var spare: u16 = 0;
for (hs, 0..) |other, j| {
if (j == k) continue;
- const extra = other -| floorRows(p, p.view().cols[c].panes[j]);
+ const extra = other -| floors[j];
if (extra > spare) {
spare = extra;
giver = j;