mirror of
https://github.com/neovim/neovim.git
synced 2026-04-05 07:09:23 +00:00
treesitter: use new on_bytes interface
This will significantly reduce the parsing work needed e.g. when rehighlighting after every keypress in insert mode. Also add safety check for tree-sitter trying to read past the end of a line. This can happen after we sent an incorrect buffer update.
This commit is contained in:
@@ -60,7 +60,7 @@ function TSHighlighter.new(query, bufnr, ft)
|
||||
ft,
|
||||
{
|
||||
on_changedtree = function(...) self:on_changedtree(...) end,
|
||||
on_lines = function() self.root = self.parser:parse():root() end
|
||||
on_bytes = function() self.root = self.parser:parse():root() end
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user