fix(treesitter): add 'QuitPre' event to autocommands in inspect_tree

Problem: Quitting source buffer for ```:InspectTree``` command raises
```E855``` when source buffer and tree views are the only open buffers.

Solution: Add ```QuitPre``` event to autocmd handling closing/hiding the
source buffer to close all open tree views. This allows nvim to quit
when source and tree buffers are the only open windows.
This commit is contained in:
hykerr 2024-11-12 12:26:07 +01:00 committed by Lewis Russell
parent 9aab98a275
commit 86b737649b

View File

@ -527,7 +527,7 @@ function M.inspect_tree(opts)
end, end,
}) })
api.nvim_create_autocmd({ 'BufHidden', 'BufUnload' }, { api.nvim_create_autocmd({ 'BufHidden', 'BufUnload', 'QuitPre' }, {
group = group, group = group,
buffer = buf, buffer = buf,
once = true, once = true,