4848--- @return boolean
4949--- @return string | nil
5050local function do_copy (source , destination )
51- local source_stats , err = vim .loop .fs_stat (source )
51+ local source_stats , err = vim .uv .fs_stat (source )
5252
5353 if not source_stats then
5454 log .line (" copy_paste" , " do_copy fs_stat '%s' failed '%s'" , source , err )
@@ -64,15 +64,15 @@ local function do_copy(source, destination)
6464
6565 if source_stats .type == " file" then
6666 local success
67- success , err = vim .loop .fs_copyfile (source , destination )
67+ success , err = vim .uv .fs_copyfile (source , destination )
6868 if not success then
6969 log .line (" copy_paste" , " do_copy fs_copyfile failed '%s'" , err )
7070 return false , err
7171 end
7272 return true
7373 elseif source_stats .type == " directory" then
7474 local handle
75- handle , err = vim .loop .fs_scandir (source )
75+ handle , err = vim .uv .fs_scandir (source )
7676 if type (handle ) == " string" then
7777 return false , handle
7878 elseif not handle then
@@ -81,14 +81,14 @@ local function do_copy(source, destination)
8181 end
8282
8383 local success
84- success , err = vim .loop .fs_mkdir (destination , source_stats .mode )
84+ success , err = vim .uv .fs_mkdir (destination , source_stats .mode )
8585 if not success then
8686 log .line (" copy_paste" , " do_copy fs_mkdir '%s' failed '%s'" , destination , err )
8787 return false , err
8888 end
8989
9090 while true do
91- local name , _ = vim .loop .fs_scandir_next (handle )
91+ local name , _ = vim .uv .fs_scandir_next (handle )
9292 if not name then
9393 break
9494 end
@@ -228,7 +228,7 @@ function Clipboard:resolve_conflicts(conflict, destination, action, action_fn)
228228 self :finish_paste (action )
229229 return
230230 end
231- if vim .loop .fs_stat (new_dest ) then
231+ if vim .uv .fs_stat (new_dest ) then
232232 self :resolve_conflicts ({ { node = conflict [1 ].node , dest = new_dest } }, destination , action , action_fn )
233233 else
234234 do_paste_one (source , new_dest , action , action_fn )
@@ -285,7 +285,7 @@ function Clipboard:resolve_conflicts(conflict, destination, action, action_fn)
285285 local extension = vim .fn .fnamemodify (item .node .name , " :e" )
286286 local new_name = extension ~= " " and (basename .. suffix .. " ." .. extension ) or (item .node .name .. suffix )
287287 local new_dest = utils .path_join ({ destination , new_name })
288- local stats = vim .loop .fs_stat (new_dest )
288+ local stats = vim .uv .fs_stat (new_dest )
289289 if stats then
290290 table.insert (still_conflict , { node = item .node , dest = new_dest })
291291 else
@@ -324,7 +324,7 @@ function Clipboard:do_paste(node, action, action_fn)
324324 end
325325
326326 local destination = node .absolute_path
327- local stats , err , err_name = vim .loop .fs_stat (destination )
327+ local stats , err , err_name = vim .uv .fs_stat (destination )
328328 if not stats and err_name ~= " ENOENT" then
329329 log .line (" copy_paste" , " do_paste fs_stat '%s' failed '%s'" , destination , err )
330330 notify .error (" Could not " .. action .. " " .. notify .render_path (destination ) .. " - " .. (err or " ???" ))
@@ -340,7 +340,7 @@ function Clipboard:do_paste(node, action, action_fn)
340340 local conflict = {}
341341 for _ , _node in ipairs (clip ) do
342342 local dest = utils .path_join ({ destination , _node .name })
343- local dest_stats = vim .loop .fs_stat (dest )
343+ local dest_stats = vim .uv .fs_stat (dest )
344344 if dest_stats then
345345 table.insert (conflict , { node = _node , dest = dest })
346346 else
@@ -374,7 +374,7 @@ local function do_cut(source, destination)
374374 end
375375
376376 events ._dispatch_will_rename_node (source , destination )
377- local success , errmsg = vim .loop .fs_rename (source , destination )
377+ local success , errmsg = vim .uv .fs_rename (source , destination )
378378 if not success then
379379 log .line (" copy_paste" , " do_cut fs_rename failed '%s'" , errmsg )
380380 return false , errmsg
0 commit comments