diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..23c6869a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3288,14 +3288,24 @@ pub const Pardes = struct { // file line-number gutter: mute the first PREFIX_W columns. Cheap // chrome, not gated on colors_on; selection/cursor passes still win. + // The cursor row's number takes the tag style (same row math as the + // cursor pass below) so the eye finds the current line. if (pane.file != null) { + const goff = pane.scroll(); + const gcur = pane.vt.screens.active.cursor; + const gcrow = if (pane.cur_pinned) pane.cur_row else @as(i32, @intCast(gcur.y)) + goff; + const cur_vr: i32 = if (active and !pane.tag_edit) gcrow - goff else -1; var vr: u16 = 0; while (vr < body_h) : (vr += 1) { + const on_cursor = @as(i32, vr) == cur_vr; var c: u16 = 0; while (c < PREFIX_W and c < tw) : (c += 1) { const cell = s.at(tx + c, r.y + BOX_H + vr); cell.default = false; // paints blank gutter rows too - cell.style.fg = .{ .rgb = th.lineno }; + if (on_cursor) { + cell.style.fg = .{ .rgb = th.tag_fg }; + cell.style.bg = .{ .rgb = th.tag_bg }; + } else cell.style.fg = .{ .rgb = th.lineno }; } } } |
