plugins/utils/nvim-tree: change implementation of autoClose (#125)

This commit is contained in:
Gaétan Lepage 2023-01-21 18:04:28 +01:00 committed by GitHub
parent 55ed602814
commit 1480ffe201
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,7 +223,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;
@ -267,6 +266,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})
'';