CopilotChat.nvim icon indicating copy to clipboard operation
CopilotChat.nvim copied to clipboard

Diff yank with 'gy' (the default mapping) doesn't work.

Open marwan-tanager opened this issue 1 year ago • 1 comments

Hi, I couldn't get the gy mapping to yank the diff in the chat window to work. Also, it doesn't work if I assign any other key combination to mappings.yank_diff.

marwan-tanager avatar Jul 04 '24 09:07 marwan-tanager

I was experiencing the same issue. I had my clipboard set to vim.o.clipboard = 'unnamedplus'. When commenting this out, I was able to successfully use the gy mapping.

The gy mapping stores the diff to the " register. You can validate that the diff is properly getting copied by running the :registers " command. After copying with gy, you need to validate the contents of the " register. If it is empty, you may be overwriting the register in some way.

https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/cfdf371cec954fccf5410315884e110d214d38fa/lua/CopilotChat/init.lua#L777

sjonpaulbrown-cc avatar Aug 07 '24 21:08 sjonpaulbrown-cc

Looks like this is resolved by register being configurable and original issue was mostly misunderstanding registers anyway I would say

deathbeam avatar Aug 31 '24 01:08 deathbeam