Skip to content

Commit 2a5c86b

Browse files
authored
fix(fs_actions): fix move/rename check (#1714)
1 parent 0b44040 commit 2a5c86b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lua/neo-tree/sources/filesystem/lib/fs_actions.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local M = {}
2222
---@param original_path string
2323
---@param destination string
2424
---@return boolean rename_is_safe
25-
local function can_safely_rename(original_path, destination)
25+
local function rename_is_safe(original_path, destination)
2626
if not loop.fs_stat(destination) then
2727
return true
2828
end
@@ -170,7 +170,7 @@ local function get_unused_name(
170170
name_chosen_callback,
171171
first_message
172172
)
173-
if can_safely_rename(source, destination) then
173+
if not rename_is_safe(source, destination) then
174174
local parent_path, name
175175
if not using_root_directory then
176176
parent_path, name = utils.split_path(destination)
@@ -632,7 +632,7 @@ local rename_node = function(msg, name, get_destination, path, callback)
632632

633633
local destination = get_destination(new_name)
634634

635-
if not can_safely_rename(path, destination) then
635+
if not rename_is_safe(path, destination) then
636636
log.warn(destination, " already exists, canceling")
637637
return
638638
end

0 commit comments

Comments
 (0)