summaryrefslogtreecommitdiff
path: root/core/Band.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Band.zig')
-rw-r--r--core/Band.zig13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/Band.zig b/core/Band.zig
index 8ee5c9f0..d60e9831 100644
--- a/core/Band.zig
+++ b/core/Band.zig
@@ -40,6 +40,9 @@ pub const Row = struct {
on: bool = false,
/// Its first `key` bytes are a key: the key ink, bold.
key: u8 = 0,
+ /// Its first `kind` bytes are a symbol's kind mark (`t`, `f`, `m`):
+ /// the keyword's ink (UX DESIGN N4).
+ kind: u8 = 0,
/// Its first `chord` bytes are a chord (Help's `SPC h t`): the key ink
/// at the text's weight.
chord: u8 = 0,
@@ -53,8 +56,9 @@ pub const Row = struct {
index: u16 = 0,
/// Marked in a picker's list: `•` before it.
mark: bool = false,
- /// Its first `pre` bytes are a place (`file:line`, `@p3`): the name's
- /// tint; the `faint` bytes after them dimmed (a path's directory).
+ /// Its first `pre` bytes are a place (`file:line`, `@p3`) or a kind
+ /// mark: the name's tint; the `faint` bytes after them dimmed (a path's
+ /// directory, a symbol's qualifier).
pre: u16 = 0,
faint: u16 = 0,
/// Said at the row's right end in the dim ink, two cells off its text
@@ -644,6 +648,7 @@ fn cutRow(arena: std.mem.Allocator, tab: u16, row: Row, room: u16) !Row {
fit.text = try std.mem.concat(arena, u8, &.{ row.text[0..cut], if (room > 0) "…" else "" });
for (row.marks) |m| if (m < cut) try marks.append(arena, m);
fit.key = @intCast(@min(row.key, cut));
+ fit.kind = @intCast(@min(row.kind, cut));
fit.pre = @intCast(@min(row.pre, cut));
fit.faint = @intCast(@min(row.faint, cut -| fit.pre));
}
@@ -681,6 +686,8 @@ test "a narrow band gives way and keeps its spines: the doc goes, the steps star
defer p.deinit();
const pane = try p.setTestFile("one\n");
const id = p.view().active;
+ // Its own text past a row: the tag takes two (UX K'1).
+ pane.tag.own = try p.gpa.dupe(u8, "words of the user's own that run on past a row");
p.sync();
const rest = pane.tag_rows;
try std.testing.expect(rest > 1);
@@ -716,6 +723,8 @@ test "out of rest with no band, the rows a tag keeps from rest stay blank: a spi
defer p.deinit();
const pane = try p.setTestFile("one\n");
const id = p.view().active;
+ // Its own text past a row: the tag takes two (UX K'1).
+ pane.tag.own = try p.gpa.dupe(u8, "words of the user's own that run on past a row");
p.sync();
const rest = pane.tag_rows;
try std.testing.expect(rest > 1);