feat: most moves and copies will copy the undofile (#583)

This commit is contained in:
Steven Arcangeli 2025-02-13 09:40:01 -08:00
parent 5313690956
commit 32dd3e378d
4 changed files with 51 additions and 6 deletions

View file

@ -151,7 +151,7 @@ end
---@field info_file string
---@field original_path string
---@field deletion_date number
---@field stat uv_fs_t
---@field stat uv.aliases.fs_stat_table
---@param info_file string
---@param cb fun(err?: string, info?: oil.TrashInfo)
@ -596,8 +596,7 @@ M.perform_action = function(action, cb)
if err then
cb(err)
else
---@diagnostic disable-next-line: undefined-field
local stat_type = trash_info.stat.type
local stat_type = trash_info.stat.type or "unknown"
fs.recursive_copy(stat_type, path, trash_info.trash_file, vim.schedule_wrap(cb))
end
end)
@ -625,8 +624,7 @@ M.delete_to_trash = function(path, cb)
if err then
cb(err)
else
---@diagnostic disable-next-line: undefined-field
local stat_type = trash_info.stat.type
local stat_type = trash_info.stat.type or "unknown"
fs.recursive_move(stat_type, path, trash_info.trash_file, vim.schedule_wrap(cb))
end
end)

View file

@ -224,7 +224,6 @@ M.delete_to_trash = function(path, cb)
end
local stat_type = src_stat.type
---@cast stat_type oil.EntryType
fs.recursive_move(stat_type, path, dest, vim.schedule_wrap(cb))
end)
)