Skip to content

Commit c2194e9

Browse files
feat(#2312): fire TextYankPost event on path copy (#2489)
* feat(#2312): fire `TextYankPost` event on path copy * stylua * Bug fix --------- Co-authored-by: Alexander Courtis <[email protected]>
1 parent a31dfad commit c2194e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/nvim-tree/actions/fs/copy-paste.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,19 @@ function M.print_clipboard()
252252
end
253253

254254
local function copy_to_clipboard(content)
255+
local clipboard_name
255256
if M.config.actions.use_system_clipboard == true then
256257
vim.fn.setreg("+", content)
257258
vim.fn.setreg('"', content)
258-
return notify.info(string.format("Copied %s to system clipboard!", content))
259+
clipboard_name = "system"
259260
else
260261
vim.fn.setreg('"', content)
261262
vim.fn.setreg("1", content)
262-
return notify.info(string.format("Copied %s to neovim clipboard!", content))
263+
clipboard_name = "neovim"
263264
end
265+
266+
vim.api.nvim_exec_autocmds("TextYankPost", {})
267+
return notify.info(string.format("Copied %s to %s clipboard!", content, clipboard_name))
264268
end
265269

266270
function M.copy_filename(node)

0 commit comments

Comments
 (0)