feat: allow no focus in toggle

fixes #968
This commit is contained in:
kiyan
2022-02-15 20:25:32 +01:00
parent 121f5c9037
commit 90ea6c01fd

View File

@@ -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