aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/treesitter.txt3
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua10
-rw-r--r--runtime/lua/vim/treesitter/languagetree.lua2
3 files changed, 2 insertions, 13 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index e439e8fccb..5fc6429f7a 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -1605,8 +1605,7 @@ LanguageTree:register_cbs({cbs}, {recursive})
• {cbs} (`table<TSCallbackNameOn,function>`) An
|nvim_buf_attach()|-like table argument with the
following handlers:
- • `on_bytes` : see |nvim_buf_attach()|, but this will be
- called after the parsers callback.
+ • `on_bytes` : see |nvim_buf_attach()|.
• `on_changedtree` : a callback that will be called every
time the tree has syntactical changes. It will be
passed two arguments: a table of the ranges (as node
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index 7bdcdc774a..4ad62f4816 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -93,9 +93,6 @@ function TSHighlighter.new(tree, opts)
opts = opts or {} ---@type { queries: table<string,string> }
self.tree = tree
tree:register_cbs({
- on_bytes = function(...)
- self:on_bytes(...)
- end,
on_detach = function()
self:on_detach()
end,
@@ -215,13 +212,6 @@ function TSHighlighter:for_each_highlight_state(fn)
end
---@package
----@param start_row integer
----@param new_end integer
-function TSHighlighter:on_bytes(_, _, start_row, _, _, _, _, _, new_end)
- api.nvim__redraw({ buf = self.bufnr, range = { start_row, start_row + new_end + 1 } })
-end
-
----@package
function TSHighlighter:on_detach()
self:destroy()
end
diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua
index fd68c2b910..4b42164dc8 100644
--- a/runtime/lua/vim/treesitter/languagetree.lua
+++ b/runtime/lua/vim/treesitter/languagetree.lua
@@ -1037,7 +1037,7 @@ end
--- Registers callbacks for the [LanguageTree].
---@param cbs table<TSCallbackNameOn,function> An [nvim_buf_attach()]-like table argument with the following handlers:
---- - `on_bytes` : see [nvim_buf_attach()], but this will be called _after_ the parsers callback.
+--- - `on_bytes` : see [nvim_buf_attach()].
--- - `on_changedtree` : a callback that will be called every time the tree has syntactical changes.
--- It will be passed two arguments: a table of the ranges (as node ranges) that
--- changed and the changed tree.