copilot-emacs / copilot.el

An unofficial Copilot plugin for Emacs.
MIT License
1.79k stars 126 forks source link

duplication of last character of suggested compeltion when user types the completion manually #133

Closed svatem1 closed 1 year ago

svatem1 commented 1 year ago

I'm using copilot.el with Spacemacs (with default vi-like keybindings) and I've set it up exactly as stated in your documentation. What's happenning to me and renders this poorly usable is the following: I'm in insert mode and typing code, I make (even short) pause in my typing and copilot suggests some completion. If I press Tab, everything is completed. If I do not pres Tab and type the same code myself (so that my typed code equals to the suggested one), after I type last character of suggested code, this last characted gets duplicated. Eg.: I type const a = and now copilot shows fn(b);. If I type fn(b); then after pressing last ; one additional semicolon is inserted automatically (this is the bug) and I end up with const a = fn(b);;. Now - why would I do it instead of pressing Tab? I do type very fast and sometimes my mind/fingers just type what I need faster then realizing I could press Tab and get it completed, usually it's when the completion is something very short. So I end up correcting what I typed very often, because copilot is messing what I write.

zerolfx commented 1 year ago

fixed in https://github.com/zerolfx/copilot.el/commit/7cb7beda89145ccb86a4324860584545ec016552