@@ -109,11 +109,11 @@ end
109
109
110
110
--- @param source string
111
111
--- @param dest string
112
- --- @param action_type string
112
+ --- @param action ACTION
113
113
--- @param action_fn fun ( source : string , dest : string )
114
114
--- @return boolean | nil -- success
115
115
--- @return string | nil -- error message
116
- local function do_single_paste (source , dest , action_type , action_fn )
116
+ local function do_single_paste (source , dest , action , action_fn )
117
117
local dest_stats
118
118
local success , errmsg , errcode
119
119
local notify_source = notify .render_path (source )
@@ -122,14 +122,14 @@ local function do_single_paste(source, dest, action_type, action_fn)
122
122
123
123
dest_stats , errmsg , errcode = vim .loop .fs_stat (dest )
124
124
if not dest_stats and errcode ~= " ENOENT" then
125
- notify .error (" Could not " .. action_type .. " " .. notify_source .. " - " .. (errmsg or " ???" ))
125
+ notify .error (" Could not " .. action .. " " .. notify_source .. " - " .. (errmsg or " ???" ))
126
126
return false , errmsg
127
127
end
128
128
129
129
local function on_process ()
130
130
success , errmsg = action_fn (source , dest )
131
131
if not success then
132
- notify .error (" Could not " .. action_type .. " " .. notify_source .. " - " .. (errmsg or " ???" ))
132
+ notify .error (" Could not " .. action .. " " .. notify_source .. " - " .. (errmsg or " ???" ))
133
133
return false , errmsg
134
134
end
135
135
@@ -147,7 +147,7 @@ local function do_single_paste(source, dest, action_type, action_fn)
147
147
vim .ui .input (input_opts , function (new_dest )
148
148
utils .clear_prompt ()
149
149
if new_dest then
150
- do_single_paste (source , new_dest , action_type , action_fn )
150
+ do_single_paste (source , new_dest , action , action_fn )
151
151
end
152
152
end )
153
153
else
@@ -161,7 +161,7 @@ local function do_single_paste(source, dest, action_type, action_fn)
161
161
vim .ui .input (input_opts , function (new_dest )
162
162
utils .clear_prompt ()
163
163
if new_dest then
164
- do_single_paste (source , new_dest , action_type , action_fn )
164
+ do_single_paste (source , new_dest , action , action_fn )
165
165
end
166
166
end )
167
167
end
0 commit comments