# HG changeset patch # User zegervdv # Date 1658848331 -7200 # Node ID 6bd8aecfdaaa0e18ba6e3b1a4b1d7bf2e739e44c # Parent 7d581ebd55081c591347f59fa0a05075ba97ba2a use the updated trim function from nvim-osc52 diff -r 7d581ebd5508 -r 6bd8aecfdaaa .chezmoitemplates/init.lua --- a/.chezmoitemplates/init.lua Tue Jul 26 09:48:51 2022 +0200 +++ b/.chezmoitemplates/init.lua Tue Jul 26 17:12:11 2022 +0200 @@ -29,24 +29,8 @@ use { 'ojroques/nvim-osc52', config = function() - require('osc52').setup { trim = false } - local copy = function(lines, _) - -- Trim indent before copying - local indent = 0 - for _, line in ipairs(lines) do - local index, _ = line:find '[^ ]' - if index ~= nil then - indent = index - break - end - end - if indent ~= nil then - for key, line in ipairs(lines) do - lines[key] = line:sub(indent) - end - end - require('osc52').copy(table.concat(lines, '\n')) - end + require('osc52').setup { trim = true } + local copy = function(lines, _) require('osc52').copy(table.concat(lines, '\n')) end local paste = function() return { vim.fn.split(vim.fn.getreg '', '\n'), vim.fn.getregtype '' } end vim.g.clipboard = { name = 'osc52',