mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-05 08:27:19 -04:00
Minor fixes
This commit is contained in:
+8
-3
@@ -216,6 +216,11 @@ func (h *Highlighter) ReHighlightLine(input LineStates, lineN int) {
|
|||||||
|
|
||||||
line := []byte(lines[lineN])
|
line := []byte(lines[lineN])
|
||||||
|
|
||||||
|
h.lastRegion = nil
|
||||||
|
if lineN > 0 {
|
||||||
|
h.lastRegion = input.State(lineN - 1)
|
||||||
|
}
|
||||||
|
|
||||||
var match LineMatch
|
var match LineMatch
|
||||||
if lineN == 0 || h.lastRegion == nil {
|
if lineN == 0 || h.lastRegion == nil {
|
||||||
match = h.highlightEmptyRegion(0, true, lineN, line)
|
match = h.highlightEmptyRegion(0, true, lineN, line)
|
||||||
@@ -247,11 +252,11 @@ func (h *Highlighter) ReHighlight(input LineStates, startline int) {
|
|||||||
curState := h.lastRegion
|
curState := h.lastRegion
|
||||||
lastState := input.State(i)
|
lastState := input.State(i)
|
||||||
|
|
||||||
|
input.SetMatch(i, match)
|
||||||
|
input.SetState(i, curState)
|
||||||
|
|
||||||
if curState == lastState {
|
if curState == lastState {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
input.SetMatch(i, match)
|
|
||||||
input.SetState(i, curState)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user