Files
eleith aaf7470d4c
ci/woodpecker/pr/ci Pipeline was successful
Group the export modules in export/
markdown.lua, json.lua and the clipboard copy (export.lua) move into
export/, unchanged. Unit specs check the whole markdown output and the
json fields.
2026-09-22 09:12:15 -07:00

18 lines
385 B
Lua

local M = {}
---@param text string
---@return boolean
function M.copy(text)
local ok = pcall(vim.fn.setreg, "+", text)
if not ok then
return false
end
-- setreg never errors when no provider is configured, so confirm the
-- register actually holds what we put in it.
local ok_read, stored = pcall(vim.fn.getreg, "+")
return ok_read and stored == text
end
return M