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:
@@ -39,15 +39,14 @@ function M.open(cwd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.tab_change()
|
function M.tab_change()
|
||||||
vim.schedule(function()
|
if view.is_visible({ any_tabpage = true }) then
|
||||||
if not view.is_visible() and view.is_visible({ any_tabpage = true }) then
|
local bufname = vim.api.nvim_buf_get_name(0)
|
||||||
local bufname = vim.api.nvim_buf_get_name(0)
|
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
|
||||||
if bufname:match("Neogit") ~= nil or bufname:match("--graph") ~= nil then
|
return
|
||||||
return
|
|
||||||
end
|
|
||||||
view.open({ focus_tree = false })
|
|
||||||
end
|
end
|
||||||
end)
|
view.open({ focus_tree = false })
|
||||||
|
require"nvim-tree.renderer".draw()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_existing_windows()
|
local function find_existing_windows()
|
||||||
|
|||||||
Reference in New Issue
Block a user