Copy to clipboard, extra line break fixed

This commit is contained in:
psychhim
2025-10-06 21:32:47 +05:30
parent 289772ff82
commit d0d51bca27
2 changed files with 73 additions and 42 deletions

View 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