Closed jtackaberry closed 5 months ago
Same issue here
Already addressed here, no word yet from @MunifTanjim yet
Can you check if https://github.com/zbirenbaum/copilot.lua/commit/3c6a1d24d8afc70a75bae2c1c3a9a09223ebbb9f fixes it?
Can you check if https://github.com/zbirenbaum/copilot.lua/commit/3c6a1d24d8afc70a75bae2c1c3a9a09223ebbb9f fixes it?
@MunifTanjim so far so good! Simple test case from my OP now works even with debounce=500, and I haven't encountered any similar issues with a bit more real coding.
Thanks!
Let's reopen if the issue comes back again.
Seems to work here too
You're typing a line of code and copilot shows ghost text of a potential suggestion. If you immediately accept the suggestion (using
<M-l>
as is the default configuration) then all is good. However, if you type a few characters into the suggestion after the ghost text appears, once you accept the suggestion, whatever characters you typed in the previousdebounce
amount of time become appended to the end of the accepted suggestion.I use AstroNvim and am constantly running into this. I did up a from-scratch nvim config with just lazy.nvim and zbirenbaum/copilot.lua and wasn't able to reproduce it nearly as much, but it still sometimes occurred. Finally I realized why: in addition to
auto_trigger=true
(which I want) astronvim's community plugin sets debounce=150 whereas copilot.lua's default is 75, so the issue is much more frequently hit with Astronvim.It still occurs with 75, as I said, but of course the window is much smaller. Unsurprisingly, it vanishes with debounce=0.
The screen capture below shows two cases. The first scenario demonstrates the working case, where the suggestion is accepted immediately without typing anything further: I type
func mai
, wait for the suggestion, and then<M-l>
to accept. The second scenario shows typing the first 3 letters of the suggestion after the ghost text appears: I typefunc m
, wait for the suggestion, quickly typeain
and then<M-l>
to accept. In this latter case, theain
I typed between suggestion and accept is appended to the end.Lazy configuration is as follows. No other plugins are loaded apart from folke/lazy.nvim: