nvim-config
nvim-config copied to clipboard
NvimTree closes nvim when opening a folder
First of all thanks a lot for this repository, it's a really nice source of inspiration.
This auto command causes neovim to close when I try to open a folder (:e /path/to/folder)
https://github.com/ttys3/nvim-config/blob/693e9e106189b6cd1399776b95997d33591e3ac8/lua/config/nvim-tree.lua#L67
Does it happen to you as well?
I didn't find a solution yet, except commenting that block.
For reference, with NerdTree it works correctly, but the command is a bit different
'if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif'
thank you for reporting this issue.
I tried and confirmed this can be re-produced
there seems no perfect implementation at this time, see:
https://github.com/kyazdani42/nvim-tree.lua/discussions/1115
https://github.com/kyazdani42/nvim-tree.lua/issues/1368
https://github.com/kyazdani42/nvim-tree.lua/issues/1005
I think we'd better disable this feature or make it configuable
Interesting, what's weird is that NERDTree works without a glitch (AFAIK).
I'll try to investigate this further when I'll some time.
Thanks for your support!!!
Moreover, in NERDTree primary has been renamed to tab, therefore that if in the auto-command never evaluate to TRUE.
Hence, it's false that it works.
Sorry for the noise, this is the last one.
This the right way to do it in NERDTree
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif