diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 8038ce8e..968218c6 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -1447,8 +1447,6 @@ vim |current-directory| behaviour. *nvim-tree.actions.change_dir.global* Use `:cd` instead of `:lcd` when changing directories. - Consider that this might cause issues with the - |nvim-tree.sync_root_with_cwd| option. Type: `boolean`, Default: `false` *nvim-tree.actions.change_dir.restrict_above_cwd* diff --git a/lua/nvim-tree/actions/fs/rename-file.lua b/lua/nvim-tree/actions/fs/rename-file.lua index ad81849c..b4f9c945 100644 --- a/lua/nvim-tree/actions/fs/rename-file.lua +++ b/lua/nvim-tree/actions/fs/rename-file.lua @@ -162,12 +162,14 @@ function M.fn(default_modifier) return end - M.rename(node, prepend .. new_file_path .. append) + local full_new_path = prepend .. new_file_path .. append + + M.rename(node, full_new_path) if not M.config.filesystem_watchers.enable then explorer:reload_explorer() end - find_file(utils.path_remove_trailing(new_file_path)) + find_file(utils.path_remove_trailing(full_new_path)) end) end end