fix: auto open on tab

it was scheduled before because of the weird management of events, but
now as it's been fixed in the latest big PR, this works just fine
without scheduling. Needs a redraw because the buffer is recreated.
This commit is contained in:
kiyan
2022-02-14 19:51:40 +01:00
parent ad2802d9c4
commit b1127c5dea

View File

@@ -39,15 +39,14 @@ function M.open(cwd)
end
function M.tab_change()
vim.schedule(function()
if not view.is_visible() and view.is_visible({ any_tabpage = true }) then
local bufname = vim.api.nvim_buf_get_name(0)
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
return
end
view.open({ focus_tree = false })
if view.is_visible({ any_tabpage = true }) then
local bufname = vim.api.nvim_buf_get_name(0)
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
return
end
end)
view.open({ focus_tree = false })
require"nvim-tree.renderer".draw()
end
end
local function find_existing_windows()