diff options
author | hykerr <hykerr@proton.me> | 2024-11-12 12:26:07 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-11-12 16:10:43 +0000 |
commit | 86b737649bb8c51649a21033c0e365f53f2bc04a (patch) | |
tree | be590596166173fcc8dc176f931b63a13a292762 /runtime/lua/vim/treesitter | |
parent | 9aab98a275cb6140540eecbe643a7943d700b58d (diff) | |
download | rneovim-86b737649bb8c51649a21033c0e365f53f2bc04a.tar.gz rneovim-86b737649bb8c51649a21033c0e365f53f2bc04a.tar.bz2 rneovim-86b737649bb8c51649a21033c0e365f53f2bc04a.zip |
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.
Diffstat (limited to 'runtime/lua/vim/treesitter')
-rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index d68a30cc11..74d796f7fa 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -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, |