fix: use defer_fn to close the tree properly
This commit is contained in:
11
lua/tree.lua
11
lua/tree.lua
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user