Skip to content

Commit

Permalink
fix(#2969): After a rename, the node loses selection (#2974)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucian Ion <lucian.ion.2005@gmail.com>
  • Loading branch information
opsidjflksdf and J60Hgjm2j4zDbKzao57ZsBZir authored Oct 27, 2024
1 parent e4bc05b commit 1403933
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/nvim-tree/actions/fs/rename-file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,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
Expand Down

0 comments on commit 1403933

Please sign in to comment.