aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
-rw-r--r--runtime/lua/vim/treesitter.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index 38ac182e32..3af66b134c 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -44,13 +44,18 @@ function M._create_parser(bufnr, lang, opts)
self:_on_bytes(...)
end
- local function detach_cb()
+ local function detach_cb(_, ...)
if parsers[bufnr] == self then
parsers[bufnr] = nil
end
+ self:_on_detach(...)
end
- a.nvim_buf_attach(self:source(), false, {on_bytes=bytes_cb, on_detach=detach_cb, preview=true})
+ local function reload_cb(_, ...)
+ self:_on_reload(...)
+ end
+
+ a.nvim_buf_attach(self:source(), false, {on_bytes=bytes_cb, on_detach=detach_cb, on_reload=reload_cb, preview=true})
self:parse()