copilot.lua icon indicating copy to clipboard operation
copilot.lua copied to clipboard

Remove possible closing bracket (or whatever closing pair)

Open abenz1267 opened this issue 3 years ago • 1 comments

Hi,

i'm facing following minor annoyance and i was wondering, if that's something this plugin COULD fix, or i need to find another solution:

so i'm using nvim-autopairs.... and with copilot snippets this can be a bit annoying. f.e.

someFunc(|)

and the copilot suggestion might already contain a closing bracket, so you end up with

someFunc(copilotsuggestion))

and you now need to remove the extra closing bracket. That's midly annoying.

Any idea how to avoid this?

Regards

abenz1267 avatar Aug 04 '22 12:08 abenz1267

I've wanted to solve this for a while since I also use pairs completion, but autopairs really doesn't like to play nice. There might be a way to selectively disable it for a source, but I haven't seen one if so. I'll try looking into it again.

zbirenbaum avatar Aug 04 '22 15:08 zbirenbaum

Thanks @zbirenbaum . Is there a way to fix this manually?

y9c avatar Oct 03 '22 20:10 y9c

Set clear_after_cursor in the copilot-cmp options to true. It will be the default soon, but I left it as opt-in to start so I’d have a chance make sure nothing broke. Sorry for not getting back about this, I resolved it in copilot-cmp but forgot to post and close here.

zbirenbaum avatar Oct 04 '22 03:10 zbirenbaum

Hi @zbirenbaum, could you send me the link to remove_after_cursor option? I can not find this setting within copilot-cmp repo.

y9c avatar Oct 04 '22 03:10 y9c

Found it. Should be clear_after_cursor. Thanks.

y9c avatar Oct 04 '22 03:10 y9c

Found it. Should be clear_after_cursor. Thanks.

Oops, sorry I was on mobile and messed that up. I fixed it in my comment case anyone finds this issue and gets confused

zbirenbaum avatar Oct 04 '22 03:10 zbirenbaum

Is there no fix if not using copilot-cmp?

matthewsia98 avatar Feb 24 '23 22:02 matthewsia98