aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-02-06 10:17:40 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2021-02-10 18:57:49 +0100
commitfa5f583981276cb3767f74bec553cfa90e47a74e (patch)
tree488cf123018992fd1e7a7732b3d033141067b4c0 /runtime/lua/vim/treesitter.lua
parent230f2ff381d7bced4d1e19bd1853ce75cbde797a (diff)
downloadrneovim-fa5f583981276cb3767f74bec553cfa90e47a74e.tar.gz
rneovim-fa5f583981276cb3767f74bec553cfa90e47a74e.tar.bz2
rneovim-fa5f583981276cb3767f74bec553cfa90e47a74e.zip
treesitter: propagate on_detach event properly
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
-rw-r--r--runtime/lua/vim/treesitter.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index 38ac182e32..70051636ec 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -44,10 +44,11 @@ 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})