@@ -27,10 +27,7 @@ function M.toggle(find_file, no_focus)
|
|||||||
local previous_buf = api.nvim_get_current_buf()
|
local previous_buf = api.nvim_get_current_buf()
|
||||||
M.open()
|
M.open()
|
||||||
if TreeExplorer and (_config.update_focused_file.enable or find_file) then
|
if TreeExplorer and (_config.update_focused_file.enable or find_file) then
|
||||||
-- if we don't schedule, it will search for NvimTree
|
M.find_file(false, previous_buf)
|
||||||
vim.schedule(function()
|
|
||||||
M.find_file(false, previous_buf)
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
if no_focus then
|
if no_focus then
|
||||||
vim.cmd "noautocmd wincmd p"
|
vim.cmd "noautocmd wincmd p"
|
||||||
@@ -134,10 +131,13 @@ function M.find_file(with_open, bufnr)
|
|||||||
M.open()
|
M.open()
|
||||||
end
|
end
|
||||||
|
|
||||||
if _config.update_focused_file.update_cwd then
|
vim.schedule(function()
|
||||||
update_base_dir_with_filepath(filepath, bufnr)
|
-- if we don't schedule, it will search for NvimTree
|
||||||
end
|
if _config.update_focused_file.update_cwd then
|
||||||
require"nvim-tree.actions.find-file".fn(filepath)
|
update_base_dir_with_filepath(filepath, bufnr)
|
||||||
|
end
|
||||||
|
require"nvim-tree.actions.find-file".fn(filepath)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.resize = view.resize
|
M.resize = view.resize
|
||||||
|
|||||||
Reference in New Issue
Block a user