summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-06 14:34:07 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commita45d29ca200341f5d41fad634c18df96605df8ab (patch)
tree026360031687e40f1e5af7c40caeb59a3b292d91 /src/pardes.zig
parentde4def3548a6729b0dfd2120495a61beef8c8c2c (diff)
downloadpardes-a45d29ca200341f5d41fad634c18df96605df8ab.tar.gz
pardes-a45d29ca200341f5d41fad634c18df96605df8ab.zip
cursor-line gutter highlight: the line number on the cursor's row takes the tag style (tag_fg/tag_bg), resolved at render time from the theme like the rest of the chrome. Same row math as the cursor pass (pinned cur_row or emulator cursor + scroll), gated on active && !tag_edit so only the focused file pane shows it. New cursorline snap script + golden proves it follows j-movement; look-file/syntax style goldens regenerated (cursor-row gutter cells only). 19/19 snap green.
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig12
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 };
}
}
}