Skip to content

fix(fs_actions): fix move/rename check #1714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/neo-tree/sources/filesystem/lib/fs_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local M = {}
---@param original_path string
---@param destination string
---@return boolean rename_is_safe
local function can_safely_rename(original_path, destination)
local function rename_is_safe(original_path, destination)
if not loop.fs_stat(destination) then
return true
end
Expand Down Expand Up @@ -170,7 +170,7 @@ local function get_unused_name(
name_chosen_callback,
first_message
)
if can_safely_rename(source, destination) then
if not rename_is_safe(source, destination) then
local parent_path, name
if not using_root_directory then
parent_path, name = utils.split_path(destination)
Expand Down Expand Up @@ -632,7 +632,7 @@ local rename_node = function(msg, name, get_destination, path, callback)

local destination = get_destination(new_name)

if not can_safely_rename(path, destination) then
if not rename_is_safe(path, destination) then
log.warn(destination, " already exists, canceling")
return
end
Expand Down
Loading