Fix error in incremental syntax highlighter
In the highlither thread We should accept a previously generated line tokenization past first_invalid_line only if the text is the same. The text can change because of insert or remove operations. Close #573.
This commit is contained in:
parent
9fb166d3cc
commit
7a435a568a
|
@ -24,7 +24,7 @@ function Highlighter:new(doc)
|
|||
for i = self.first_invalid_line, max do
|
||||
local state = (i > 1) and self.lines[i - 1].state
|
||||
local line = self.lines[i]
|
||||
if not (line and line.init_state == state) then
|
||||
if not (line and line.init_state == state and line.text == self.doc.lines[i]) then
|
||||
self.lines[i] = self:tokenize_line(i, state)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue