From ffe7ddb4aaa3b1029e7f210194a3f74da21f9c5b Mon Sep 17 00:00:00 2001 From: Chris Paganon Date: Tue, 29 Sep 2026 14:38:46 +0200 Subject: [PATCH] fix(highlight): apply parent patterns before nested regions When a child region starts later on a line, apply the current region rules to the preceding text before entering the child. This restores keywords such as import and const before quoted strings without changing the child region or end-of-line state handling. --- pkg/highlight/highlighter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/highlight/highlighter.go b/pkg/highlight/highlighter.go index a13a72610d..d7b90628a7 100644 --- a/pkg/highlight/highlighter.go +++ b/pkg/highlight/highlighter.go @@ -146,7 +146,7 @@ func (h *Highlighter) highlightRegion(highlights LineMatch, start int, canMatchE if !statesOnly { highlights[start+firstLoc[0]] = firstRegion.limitGroup } - h.highlightEmptyRegion(highlights, start+firstLoc[1], canMatchEnd, lineNum, sliceStart(line, firstLoc[1]), statesOnly) + h.highlightRegion(highlights, start, false, lineNum, sliceEnd(line, firstLoc[0]), curRegion, statesOnly) h.highlightRegion(highlights, start+firstLoc[1], canMatchEnd, lineNum, sliceStart(line, firstLoc[1]), firstRegion, statesOnly) return highlights }