codeium.vim icon indicating copy to clipboard operation
codeium.vim copied to clipboard

Accept corrupts special registers

Open ragu-manjegowda opened this issue 2 years ago • 1 comments

I have the following to accept suggestion,

vim.keymap.set('i', '<C-e>', function()
    return vim.fn['codeium#Accept']()
end, { expr = true, silent = true, desc = 'Codeium accept suggestion' })

and the following to manage clipboard,

if vim.fn.has('clipboard') == 1 then
  if vim.fn.has('unnamedplus') == 1 then
    vim.o.clipboard = 'unnamedplus'
  else
    vim.o.clipboard = 'unnamed'
  end

Whenever I accept codeium suggestion, contents of following special registers gets erased/corrupted.

on MacOS -> `", *, +, -`
on Linux ->  `", +, -`

I am using xclip on Linux (Arch, Ubuntu 20.04), and pbcopy on MacOS.

Let me know if you need any other information.

ragu-manjegowda avatar Apr 06 '23 06:04 ragu-manjegowda

I was scratching my head about this issue. My clipboard would randomly change or be blank or only have parts of what I'd copy. I thought it was something else about my setup, but it's definitely the accepting of a suggestion that causes it, which is why it seemed so random.

AlansCodeLog avatar Jul 02 '23 01:07 AlansCodeLog