Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
647 stars 50 forks source link

fix: replace full completion range #55

Closed dmnkgrc closed 1 year ago

dmnkgrc commented 1 year ago

Currently when accepting a completion the suffix after the cursor is not replaced, as shown in the recording the closing } remains which is part of the completion:

https://github.com/jcdickinson/codeium.nvim/assets/4812676/ce171113-da2e-4e3e-b22b-d47ede676824

The Codeium API response contains information about where the completion ends that can be used to pass the full range to cmp, which results in the following:

https://github.com/jcdickinson/codeium.nvim/assets/4812676/d1a8c4ec-bed1-416f-837c-f2f00700d978

Thanks for the great plugin 🙏

jcdickinson commented 1 year ago

This is awesome, thank you. There's currently a few hacks that attempt to do this because I didn't know how to get nvim-cmp to do this