chore: move focus_file to utils

This commit is contained in:
kiyan
2022-07-11 16:55:33 +02:00
parent df92f1527f
commit 078a9e5bf9
2 changed files with 8 additions and 8 deletions

View File

@@ -328,4 +328,11 @@ function M.debounce(context, timeout, callback)
)
end
function M.focus_file(path)
local _, i = M.find_node(require("nvim-tree.core").get_explorer().nodes, function(node)
return node.absolute_path == path
end)
require("nvim-tree.view").set_cursor { i + 1, 1 }
end
return M