summaryrefslogtreecommitdiff
path: root/core/Band.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Band.zig')
-rw-r--r--core/Band.zig19
1 files changed, 9 insertions, 10 deletions
diff --git a/core/Band.zig b/core/Band.zig
index d60e9831..228dcad0 100644
--- a/core/Band.zig
+++ b/core/Band.zig
@@ -782,7 +782,7 @@ test "Help's rows say the chord, two blanks and the word; the group is the row's
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
const a = frame.allocator();
- const selected = p.chromeTheme().roles.selectedOn(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused);
+ const selected = &p.chrome().on(.focus).selection;
for ([_]u21{ ' ', '?', 'w', 'r', 'a', 'p' }) |c| p.update(.{ .key = .{ .cp = c } });
const band = (try of(p, a, pane, id)).?;
const step = band.steps[0];
@@ -1021,14 +1021,13 @@ test "a band is drawn in the theme's roles (UX D4): spines in the rule ink, a ch
};
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 40 });
defer p.deinit();
- const pane = try p.setTestFile("one\n");
+ _ = try p.setTestFile("one\n");
const id = p.view().active;
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
const a = frame.allocator();
- const roles = &p.chromeTheme().roles;
- const inks = roles.on(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused);
- const selected = roles.selectedOn(if (pardes.Trail.reading(p, pane)) .reading_focused else .focused);
+ const inks = p.chrome().on(.focus);
+ const selected = &inks.selection;
// Help with `wrap` typed: `▶ SPC t w · Wrap · view` on the cursor row.
for ([_]u21{ ' ', '?', 'w', 'r', 'a', 'p' }) |c| p.update(.{ .key = .{ .cp = c } });
_ = try p.render(a);
@@ -1043,19 +1042,19 @@ test "a band is drawn in the theme's roles (UX D4): spines in the rule ink, a ch
}
if (std.mem.eql(u8, cell.grapheme(), "▶")) {
cursor_row = row;
- // The cursor's `▶` in the key ink on the selection, which
- // covers its lead too (UX D4, D5).
- try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, cell.style.fg);
+ // The cursor's `▶` in the key ink held on the selection, which
+ // covers its lead too (UX D4, D5; DESIGN.md B1.3).
+ try std.testing.expectEqual(pardes.Color{ .rgb = selected.key }, cell.style.fg);
try std.testing.expectEqual(pardes.Color{ .rgb = selected.ground }, cell.style.bg);
}
};
try std.testing.expect(spines > 0);
const on = layer.cells[cursor_row.? * layer.cols ..][0..layer.cols];
const s_cell = on[Cells.find(on, "SPC t w").?];
- try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, s_cell.style.fg);
+ try std.testing.expectEqual(pardes.Color{ .rgb = selected.key }, s_cell.style.fg);
try std.testing.expect(!s_cell.style.bold);
var matched: usize = 0;
- for (on) |cell| if (std.meta.eql(cell.style.fg, pardes.Color{ .rgb = roles.match })) {
+ for (on) |cell| if (std.meta.eql(cell.style.fg, pardes.Color{ .rgb = selected.match })) {
try std.testing.expect(cell.style.bold);
try std.testing.expectEqual(pardes.Color{ .rgb = selected.ground }, cell.style.bg);
matched += 1;