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 authored and Lewis Russell committed 2024-11-12 16:10:43 +00:00
1 parent 9aab98a275
commit 86b737649b
1 file changed
+1 -1
+1 -1
View File
@@ -527,7 +527,7 @@ function M.inspect_tree(opts)
end,
})
api.nvim_create_autocmd({ 'BufHidden', 'BufUnload' }, {
api.nvim_create_autocmd({ 'BufHidden', 'BufUnload', 'QuitPre' }, {
group = group,
buffer = buf,
once = true,