Can't save to clipboard on macOS
I can successfully save to disk, but I can't save to the clipboard. I even complied it fully (as a troubleshooting step) versus the default (which also didn't work) and it still yields this error crashing neovim.
Error: Process exited with error code 138
macOS 14.5 (23F79)
neovim version
NVIM VO. 10.0
Build type: Release
LuaJIT 2.1.1713484068
Using kitty 0.36.0
Hi @jondkinney, can you provide screen record for describe this issue? Cause I'm on MacOS but Apple Silicon, I can't reproduce this issue
I've just installed CodeSnap and can't save to clipboard either. Running on a M4 MacMini.
return {
"mistricky/codesnap.nvim",
build = "make",
keys = {
{ "<leader>cc", "<cmd>CodeSnap<cr>", mode = "x", desc = "Save selected code snapshot into clipboard" },
{ "<leader>cs", "<cmd>CodeSnapSave<cr>", mode = "x", desc = "Save selected code snapshot in ~/Pictures" },
},
config = function()
require("codesnap").setup({
mac_window_bar = true,
title = "",
has_breadcrumbs = true,
watermark = "",
save_path = "~/Pictures",
bg_theme = "bamboo",
})
end,
}
EDIT It does work but I have to execute the command twice for it to be put into clipboard.
Hey @Kazuto there's a fix for this; it has to do with how the v and x registers are updated (after exiting them). What I've done to get this to work:
-- other configs...
keys = {
{ "<leader>cs", "<Esc><cmd>CodeSnap<cr>", mode = "x", desc = "Save selected code snapshot into clipboard" },
{ "<leader>cS", "<Esc><cmd>CodeSnapSave<cr>", mode = "x", desc = "Save selected code snapshot in ~/Pictures" },
},
-- ...
And it works without having to do the command twice!
Interestingly, saving to clipboard works for me on OSX out of the box - no additional config, running on M4 Max + Kitty