Skip to content

Commit d502074

Browse files
committed
refactor(#2831): multi instance clipboard
1 parent 632ad2c commit d502074

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lua/nvim-tree/actions/fs/copy-paste.lua renamed to lua/nvim-tree/actions/fs/clipboard.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ end
109109

110110
---@param source string
111111
---@param dest string
112-
---@param action_type string
112+
---@param action ACTION
113113
---@param action_fn fun(source: string, dest: string)
114114
---@return boolean|nil -- success
115115
---@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)
117117
local dest_stats
118118
local success, errmsg, errcode
119119
local notify_source = notify.render_path(source)
@@ -122,14 +122,14 @@ local function do_single_paste(source, dest, action_type, action_fn)
122122

123123
dest_stats, errmsg, errcode = vim.loop.fs_stat(dest)
124124
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 "???"))
126126
return false, errmsg
127127
end
128128

129129
local function on_process()
130130
success, errmsg = action_fn(source, dest)
131131
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 "???"))
133133
return false, errmsg
134134
end
135135

@@ -147,7 +147,7 @@ local function do_single_paste(source, dest, action_type, action_fn)
147147
vim.ui.input(input_opts, function(new_dest)
148148
utils.clear_prompt()
149149
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)
151151
end
152152
end)
153153
else
@@ -161,7 +161,7 @@ local function do_single_paste(source, dest, action_type, action_fn)
161161
vim.ui.input(input_opts, function(new_dest)
162162
utils.clear_prompt()
163163
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)
165165
end
166166
end)
167167
end

0 commit comments

Comments
 (0)