summaryrefslogtreecommitdiff
path: root/core/Pick.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Pick.zig')
-rw-r--r--core/Pick.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/Pick.zig b/core/Pick.zig
index 2b5714cb..dcb838f3 100644
--- a/core/Pick.zig
+++ b/core/Pick.zig
@@ -677,10 +677,9 @@ fn rowAt(p: *Pardes, pk: *const Pick, arena: std.mem.Allocator, i: usize) std.me
for (marks_in, row.marks) |*m, at| m.* = at -| line;
row.marks = marks_in;
const name_at = cand.key - line;
- const dot = std.mem.lastIndexOfScalar(u8, row.text[name_at .. name_at + cand.key_len], '.');
row.kind = @intCast(name_at - 1);
row.pre = @intCast(name_at);
- row.faint = @intCast(if (dot) |at| at + 1 else 0);
+ row.faint = cand.base;
if (name_at + cand.key_len < row.text.len) row.quiet = .{ @intCast(name_at + cand.key_len), @intCast(row.text.len) };
const owner = p.panes[p.paneBySerial(pk.owner) orelse return row] orelse return row;
const f = owner.file orelse return row;
@@ -3357,7 +3356,7 @@ const counts_zig =
\\pub fn count(text: []const u8) Counts {
\\ return .{ .lines = text.len };
\\}
- \\test "count" {}
+ \\test "count.add" {}
\\
;
@@ -3381,9 +3380,12 @@ test "Symbols (UX DESIGN N): a Zig file's rows types, functions, fields, then th
\\ 1 n std = @import("std")
\\ 5 c Counts.zero : Counts = .{}
\\12 v hits : u32 = 0
- \\16 · "count"
+ \\16 · "count.add"
\\
, try rowLines(p, a));
+ // The qualifier dim, `Counts.`; a name holding a `.` none of it.
+ try std.testing.expectEqual(@as(u16, "Counts.".len), (try rowAt(p, live(p).?, a, 4)).faint);
+ try std.testing.expectEqual(@as(u16, 0), (try rowAt(p, live(p).?, a, 11)).faint);
// Drawn: `m Counts.lines : usize = 0` (not the cursor's row).
const pane = p.panes[p.paneBySerial(live(p).?.landing).?].?;
_ = try p.render(a);