mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-14 11:31:01 +00:00
Small optimization to state only highlighting
This commit is contained in:
parent
9c5ab2afbd
commit
e2b7c85955
1 changed files with 2 additions and 2 deletions
|
|
@ -100,15 +100,15 @@ func (h *Highlighter) highlightRegion(highlights LineMatch, start int, canMatchE
|
|||
if region.parent == nil {
|
||||
if !statesOnly {
|
||||
highlights[start+loc[1]] = 0
|
||||
h.highlightRegion(highlights, start, false, lineNum, line[:loc[0]], region, statesOnly)
|
||||
}
|
||||
h.highlightRegion(highlights, start, false, lineNum, line[:loc[0]], region, statesOnly)
|
||||
h.highlightEmptyRegion(highlights, start+loc[1], canMatchEnd, lineNum, line[loc[1]:], statesOnly)
|
||||
return highlights
|
||||
}
|
||||
if !statesOnly {
|
||||
highlights[start+loc[1]] = region.parent.group
|
||||
h.highlightRegion(highlights, start, false, lineNum, line[:loc[0]], region, statesOnly)
|
||||
}
|
||||
h.highlightRegion(highlights, start, false, lineNum, line[:loc[0]], region, statesOnly)
|
||||
h.highlightRegion(highlights, start+loc[1], canMatchEnd, lineNum, line[loc[1]:], region.parent, statesOnly)
|
||||
return highlights
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue