From fa5f583981276cb3767f74bec553cfa90e47a74e Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 6 Feb 2021 10:17:40 +0100 Subject: treesitter: propagate on_detach event properly --- runtime/lua/vim/treesitter.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/treesitter.lua') 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}) -- cgit