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
6264caffe1
commit
8477818c96
|
@ -24,7 +24,7 @@ function Highlighter:new(doc)
|
||||||
for i = self.first_invalid_line, max do
|
for i = self.first_invalid_line, max do
|
||||||
local state = (i > 1) and self.lines[i - 1].state
|
local state = (i > 1) and self.lines[i - 1].state
|
||||||
local line = self.lines[i]
|
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)
|
self.lines[i] = self:tokenize_line(i, state)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue