Add early return for empty highlights

This commit is contained in:
Aljaž Grilc 2025-02-27 14:15:50 +01:00
parent bb822f0bbc
commit 17a80ab0a9

View File

@ -366,6 +366,7 @@ class BesService {
const scrollX = scrollPanelRect.left
const scrollY = scrollPanelRect.top
match.highlights = Array.from(range.getClientRects())
if (match.highlights.length === 0) return
const dpr = window.devicePixelRatio
this.ctx.lineWidth = 2 * dpr // Use 2 for clearer visibility
const ruleId = match.match.rule.id