fix(#1940): NvimTreeFindFileToggle focus tree

This commit is contained in:
Alexander Courtis 2023-01-26 10:38:47 +11:00
parent 7944e479c1
commit 9e87ee2d6e
2 changed files with 2 additions and 3 deletions

View File

@ -1277,7 +1277,7 @@ api.tree.reload() *nvim-tree.api.tree.reload()*
Refresh the tree. Does nothing if closed.
api.tree.change_root({path}) *nvim-tree.api.tree.change_root()*
Change the tree's root to a path.
Change the tree's root to a path.
Parameters: ~
• {path} (string) absolute or relative path
@ -1296,7 +1296,6 @@ api.tree.change_root_to_parent({node})
Parameters: ~
• {node} (Node) folder or file
api.tree.get_node_under_cursor() *nvim-tree.api.tree.get_node_under_cursor()*
Retrieve the currently focused node.

View File

@ -351,7 +351,7 @@ local function setup_vim_commands()
find_file(true, nil, res.bang)
end, { bang = true, bar = true })
vim.api.nvim_create_user_command("NvimTreeFindFileToggle", function(res)
M.toggle { find_file = true, focus = false, path = res.args, update_root = res.bang }
M.toggle { find_file = true, focus = true, path = res.args, update_root = res.bang }
end, { bang = true, nargs = "?", complete = "dir" })
vim.api.nvim_create_user_command("NvimTreeResize", function(res)
M.resize(res.args)