fix: use defer_fn to close the tree properly

This commit is contained in:
kyazdani42
2020-06-04 23:29:10 +02:00
parent 3997c53df6
commit f6b38bb364

View File

@@ -90,12 +90,11 @@ local function find_file()
end end
function M.on_leave() function M.on_leave()
if #api.nvim_list_wins() == 2 vim.defer_fn(function()
and tree.win_open() if #api.nvim_list_wins() == 1 and tree.win_open() then
and api.nvim_get_current_buf() ~= tree.Tree.bufnr api.nvim_command(':qa!')
then end
api.nvim_command(':qa!') end, 50)
end
end end
local function update_root_dir() local function update_root_dir()