mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 06:17:12 +09:00
Small optimization to state only highlighting
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user