* feat(#2312): fire `TextYankPost` event on path copy * stylua * Bug fix --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -252,15 +252,19 @@ function M.print_clipboard()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function copy_to_clipboard(content)
|
local function copy_to_clipboard(content)
|
||||||
|
local clipboard_name
|
||||||
if M.config.actions.use_system_clipboard == true then
|
if M.config.actions.use_system_clipboard == true then
|
||||||
vim.fn.setreg("+", content)
|
vim.fn.setreg("+", content)
|
||||||
vim.fn.setreg('"', content)
|
vim.fn.setreg('"', content)
|
||||||
return notify.info(string.format("Copied %s to system clipboard!", content))
|
clipboard_name = "system"
|
||||||
else
|
else
|
||||||
vim.fn.setreg('"', content)
|
vim.fn.setreg('"', content)
|
||||||
vim.fn.setreg("1", content)
|
vim.fn.setreg("1", content)
|
||||||
return notify.info(string.format("Copied %s to neovim clipboard!", content))
|
clipboard_name = "neovim"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_exec_autocmds("TextYankPost", {})
|
||||||
|
return notify.info(string.format("Copied %s to %s clipboard!", content, clipboard_name))
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.copy_filename(node)
|
function M.copy_filename(node)
|
||||||
|
|||||||
Reference in New Issue
Block a user