summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/mouse.zig')
-rw-r--r--core/mouse.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/mouse.zig b/core/mouse.zig
index 89a8c5c6..6516ea71 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -914,10 +914,11 @@ fn bandPoint(p: *Pardes, mcol: u16, mrow: u16) ?BandPoint {
if (v.pointer_tag_hit) |hit| return if (hit.kind == .band) .{ .id = hit.id, .line = hit.line, .col = hit.col } else null;
const id = paneAt(p, mcol, mrow) orelse return null;
const pane = p.panes[id].?;
- if (pane.band_rows == 0) return null;
+ const rows = pardes.Band.shownRows(p, pane, id);
+ if (rows == 0) return null;
const r = v.rects[id];
const top = p.tagTop(pane, r) + (pane.tag_rows - pane.band_rows);
- if (mrow < top or mrow >= top + pane.band_rows or mcol < r.x + TAG_TEXT_INSET) return null;
+ if (mrow < top or mrow >= top + rows or mcol < r.x + TAG_TEXT_INSET) return null;
return .{ .id = id, .line = mrow - top, .col = mcol - (r.x + TAG_TEXT_INSET) };
}