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:
@@ -110,8 +110,11 @@ function M.fn(node)
|
|||||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||||
else
|
else
|
||||||
-- synchronous call required so that we may focus the file now
|
-- synchronous call required so that we may focus the file now
|
||||||
|
node = node.nodes ~= nil and node or node.parent
|
||||||
|
if node then
|
||||||
watch.refresh_path(node.absolute_path)
|
watch.refresh_path(node.absolute_path)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
utils.focus_file(utils.path_remove_trailing(new_file_path))
|
utils.focus_file(utils.path_remove_trailing(new_file_path))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user