mirror of
https://github.com/neovim/neovim.git
synced 2026-03-23 17:10:52 +00:00
treesitter: propagate on_detach event properly
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user