summaryrefslogtreecommitdiff
path: root/core/body_layer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/body_layer.zig')
-rw-r--r--core/body_layer.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/body_layer.zig b/core/body_layer.zig
index 46a98760..8c156a84 100644
--- a/core/body_layer.zig
+++ b/core/body_layer.zig
@@ -332,9 +332,9 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane
drawWrapMarkers(p, s, pane, r, tx, tw, body_h, pane_bg);
// A picker's landing line under the places it lights (UX D7).
const landing = pardes.Pick.landingLine(p, arena, pane);
- if (landing) |line| paintLanding(p, s, pane, r, tx, tw, body_h, line);
+ if (landing) |at| paintLanding(p, s, pane, r, tx, tw, body_h, at.line);
pane.places.paint(p, s, pane, r, body_h);
- if (landing) |line| paintLandingSpan(p, s, pane, r, f, line);
+ if (landing) |at| paintLandingSpan(p, s, pane, r, f, at.line, at.col);
pardes.Prompt.paintGutter(p, s, pane, r, body_h);
panes.Query.paint(p, s, pane, r, body_h);
} else if (pane.isTerminal()) {
@@ -688,14 +688,14 @@ fn paintLanding(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, tx: u16, tw: u16,
}
}
-/// The landing line's matched span (a Grep's match at the row's column) as
-/// the current hit, solid in the hue with the page's ink, over the places
-/// lit on it (UX D7, R8).
-fn paintLandingSpan(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, f: *panes.File.State, line: usize) void {
+/// The landing line's matched span (a Grep's match at the row's column,
+/// byte `col` of the line) as the current hit, solid in the hue with the
+/// page's ink, over the places lit on it (UX D7, R8).
+fn paintLandingSpan(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, f: *panes.File.State, line: usize, col: usize) void {
if (!pane.places.shows(pane)) return;
const hits = pane.places.hits.items;
const ls = File.lineStart(p.gpa, f, line);
- const caret = ls + @as(usize, @intCast(@max(0, pane.body.cur_col)));
+ const caret = ls + col;
var i = panes.Places.firstFrom(hits, ls);
while (i < hits.len and hits[i].start <= caret) : (i += 1) {
if (hits[i].end <= caret) continue;