mirror of
https://github.com/hyzendust/KickestEnd.nvim.git
synced 2026-02-15 03:41:14 +01:00
Copy to clipboard, extra line break fixed
This commit is contained in:
12
lua/copy_to_clipboard_fix.lua
Normal file
12
lua/copy_to_clipboard_fix.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local M = {}
|
||||
|
||||
function M.trim_clipboard()
|
||||
local content = vim.fn.getreg '+'
|
||||
-- Remove single trailing newline if present
|
||||
content = content:gsub('\n$', '')
|
||||
vim.fn.setreg('+', content)
|
||||
vim.fn.setreg('*', content)
|
||||
vim.notify('Copied to clipboard', vim.log.levels.INFO)
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user