From 17a80ab0a9de63daf0075dc11fa2b10a05719ceb Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Thu, 27 Feb 2025 14:15:50 +0100 Subject: [PATCH] Add early return for empty highlights --- service.js | 1 + 1 file changed, 1 insertion(+) diff --git a/service.js b/service.js index 7ff1c03..71740d0 100644 --- a/service.js +++ b/service.js @@ -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