plugins/utils/nvim-tree: change implementation of autoClose

This commit is contained in:
Gaetan Lepage 2023-01-16 10:23:17 +01:00
parent d0910a6ddb
commit 7a354187cb

View file

@ -217,7 +217,6 @@ in
hijack_netrw = cfg.hijackNetrw;
open_on_setup = cfg.openOnSetup;
ignore_ft_on_setup = cfg.ignoreFtOnSetup;
auto_close = cfg.autoClose;
open_on_tab = cfg.openOnTab;
hijack_cursor = cfg.hijackCursor;
update_cwd = cfg.updateCwd;
@ -261,6 +260,14 @@ in
nvim-web-devicons
];
autoCmd = mkIf cfg.autoClose [
{
event = "BufEnter";
command = "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif";
nested = true;
}
];
extraConfigLua = ''
require('nvim-tree').setup(${helpers.toLuaObject options})
'';