copilot.el
copilot.el copied to clipboard
Out-of-order characters with typescript-mode when electric-indent-mode is activated and an active suggestion is shown
I've managed to reproduce this on a minimal setup, loading only typescript-mode
(which activates electric-indent-mode
, copilot.el
(latest HEAD, 2c1c425).
https://asciinema.org/a/7j1X1KGr85Nl6Vm3VmlZnOS0o
Given the following (bold is typed, non-bold is suggestion, | is cursor):
add|(1, 2)
If I type a '(', and then type a ')', I end up with
add)|(
That is to say, the characters come out-of-order.
Disabling electric-indent-mode
in typescript-mode resolves it.
For some reason, the out-of-order behavior doesn't happen with js-mode, even though electric-indent-mode is configured for those modes too. Further investigation required.
Can you confirm the version of copilot.el
you are running?
@emil-vdw I'm running commit 2c1c425. According to the package header... "0.0.1" (probably not useful)
Emacs version is 29.1
I have a functioning work-around.
https://gist.github.com/timcharper/faf25e59fcf1aee876f25a754395e40c
At least this will alleviate suffering to my fellow Emacs wielding typescript devs.
It's a bit horrible since the modification of copilot-completion-map is not buffer-local, so it bleeds to all modes. That could be improved. But, best would be the root issue can be solved.
Thank you very much @timcharper !!
Thank you @timcharper
Thank you @timcharper