fix(fs): create file failure when reloading watch path for node

because node can be a file or a symlink.
fixes #1633
This commit is contained in:
kiyan 2022-10-08 16:11:34 +02:00
parent b4d704e88d
commit 3d58a9b2cf

View File

@ -110,7 +110,10 @@ function M.fn(node)
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
else
-- synchronous call required so that we may focus the file now
watch.refresh_path(node.absolute_path)
node = node.nodes ~= nil and node or node.parent
if node then
watch.refresh_path(node.absolute_path)
end
end
utils.focus_file(utils.path_remove_trailing(new_file_path))
end)