diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 07:47:23 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 08:05:42 -0300 |
| commit | 59e1178acaabaa5ef16ed829b854542c21394d6f (patch) | |
| tree | 8c963c02704387bf2d5d6e684867a186d937f6cd /core/Pick.zig | |
| parent | c225fe093d7b4cb23bd5f66c7369f93beb5cfb18 (diff) | |
| download | pardes-59e1178acaabaa5ef16ed829b854542c21394d6f.tar.gz pardes-59e1178acaabaa5ef16ed829b854542c21394d6f.zip | |
Pick: the band's spines hang from a themes or actions picker's key cells again, not from its hint: TagState.Head says its first `cells` spans are its key cells (Band.zig takes the spines' columns from `h.spans[0..h.cells]`), and P2's D4 colour roles (zvmmwotv: `⏎ wear it · esc` in the dim ink) put the hint's dim span before them in Pick.head's no-second-row branch, which the M5 merge gave the actions picker too; RUN (the M5 merge's behaviour-test, 279/280): language_servers.zig "SPC l a lists the server's code actions ..." failed at its ` 2 mock action: add a line` (NotOnScreen): on its 80-column screen the three spines stood side by side at columns 53-55, the hint's first cells (the key cells `␣ l a` are at 34, 36, 38), so the rows step began at 56 and its rows were cut at 24 cells (` 2 mock action: add a l`); P3's tip and P2's tip each passed (P3's head had no hint span, P2's themes picker has no test that reads the spines' columns); a user met it on every themes picker (P2) and every actions picker (the merge): spines bunched at the hint, the rows pushed right and cut; FIX: the key cells' spans first, the hint's after them; TEST FIRST: Pick.zig "the themes picker marks the theme in use ..." asks that the head's first `cells` spans are key cells (expected .key, found .dim before the fix); the behaviour test passes after it; core-test 1072/1242 (170 skipped), behaviour-test 280/280 and --replay 280/280, process-test 0 of 147 failed (3 skipped), pane-test 183/184, shell-test 1290/1293 (3 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Pick.zig')
| -rw-r--r-- | core/Pick.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Pick.zig b/core/Pick.zig index 3bc8c858..41a62201 100644 --- a/core/Pick.zig +++ b/core/Pick.zig @@ -633,8 +633,9 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?TagState.Head { if (pk.source == .themes or pk.source == .actions) { const hint: u32 = @intCast(text.items.len); try text.appendSlice(arena, if (pk.source == .themes) " ⏎ wear it · esc" else " ⏎ or 1-9 apply it · esc"); - try spans.append(arena, .{ .lo = hint, .hi = @intCast(text.items.len), .style = .dim }); + // The key cells first: the band's spines hang from them. for (cells[0..ncells]) |c| try spans.append(arena, .{ .lo = c[0], .hi = c[1], .style = .key }); + try spans.append(arena, .{ .lo = hint, .hi = @intCast(text.items.len), .style = .dim }); return .{ .text = text.items, .spans = spans.items, .cells = @intCast(ncells), .caret = caret }; } // The second row: the spines go on through it from the key cells, @@ -2231,6 +2232,11 @@ test "the themes picker marks the theme in use: `in use` at its row's right end for (" tt") |c| p.update(.{ .key = .{ .cp = c } }); const s = &p.view().tag_state; try std.testing.expectEqual(@as(u16, @intCast(was)), s.rows.at); + // The band's spines hang from the head's first `cells` spans: its key + // cells (`␣ t`), never its dim hint. + const h = (try head(p, a, pane)).?; + try std.testing.expectEqual(@as(u8, 2), h.cells); + for (h.spans[0..h.cells]) |span| try std.testing.expectEqual(TagState.Style.key, span.style); const Find = struct { fn row(band: Band, text: []const u8) ?Band.Row { for (band.steps[0..band.nsteps]) |step| for (step.rows) |r| if (std.mem.eql(u8, r.text, text)) return r; |
