diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 12:09:51 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 12:14:12 -0300 |
| commit | 1b9fbd1a2eea7a48c5a9575ecc2f4d31ed47909d (patch) | |
| tree | 4dd93baed704855216d4b285831cb0c61ac74be9 /core | |
| parent | 8af71053adc306b81c39429d6d1758bb6c81d363 (diff) | |
| download | pardes-1b9fbd1a2eea7a48c5a9575ecc2f4d31ed47909d.tar.gz pardes-1b9fbd1a2eea7a48c5a9575ecc2f4d31ed47909d.zip | |
Band, layout: out of rest the notice row no longer makes a picker's band a second time each frame, and the layout works each pane's floor out once a pass (X1's perf notes on M7): Band.docLeft (the first line of a doc the band had no room for, which Messages.noticeRow asks every frame while a state is out of rest and no picker sentence leads) built the whole band again (Band.of: for a picker Pick.steps, its rows read from the source) only to find no doc: a picker's steps are lists, never a doc, so it returns at once on the `.pick` kind (a picker that previews already skips it: its D7 sentence leads; this is the themes and actions pickers and any picker with its preview turned off); prompts keep the call: `:`'s names have a doc step (Command.steps) and an answered `|` shows its output as one (Prompt.steps), so X1's "prompts have no doc" holds only for `/`'s history, and `/` with no history already returns on `takes == 0`; layout.keepTerminalFloors asked floorRows of every other pane for each row it moved, and a band host's floor wraps its tag twice (its rows at rest, wantedTagRows, and its head, headRows): the floors go into a MAX_PANES array once a pass (nothing in that loop moves them: each reads the state, the pane's width and its tag rows, never the heights it hands out), so a terminal under its floor in a band host's column no longer wraps the host's tag twice a row; NOT DONE: the floor's two wraps themselves (once a pass in a text column, as before) and Pardes.sync's own two for the same host (`kept` and the head's rows) are the same two numbers, each worked out twice in one sync: sharing them needs a stored value (a derived pane field, in the replica's lists), not a few lines: left; no behaviour moves (no test can tell: the doc is null either way, the floors the same); core-test 1095/1266 (171 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core')
| -rw-r--r-- | core/Band.zig | 2 | ||||
| -rw-r--r-- | core/layout.zig | 9 |
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; |
