diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 518df34c..7a98381f 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -20,7 +20,7 @@ end ---@deprecated M.on_keypress = require'nvim-tree.actions'.on_keypress -function M.toggle(find_file) +function M.toggle(find_file, no_focus) if view.is_visible() then view.close() else @@ -28,6 +28,9 @@ function M.toggle(find_file) if TreeExplorer and (_config.update_focused_file.enable or find_file) then M.find_file(false) end + if no_focus then + vim.cmd "wincmd p" + end end end