Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.05k stars 145 forks source link

Getting dropped into Insert Mode using `Telescope` #80

Closed kohane27 closed 1 year ago

kohane27 commented 1 year ago

https://user-images.githubusercontent.com/57322459/220825282-a2ef4170-b4c7-4509-8b2d-2f93b873047b.mp4

To reproduce:

  1. enable codeium (as shown in the beginning of the video, auto-completion works)
  2. escape into Normal Mode
  3. trigger <cmd>lua require('telescope.builtin').git_files()<CR> with C-g for finding files in Telescope
  4. select target file
  5. get dropped into Insert Mode (as seen by my random typing dfdfdf)

After disabling codeium, I no longer have this issue.

Any input is much appreciated. Thank you.

MisterFISHUP commented 1 year ago

I have the same problem (using nvim v0.8.3 on ubuntu 22.04). I always thought it was my telescope that was broken until I saw this issue, and it's true that disabling Codeium removes the bug.

stevie-b-g commented 1 year ago

Yeah, I have the same issue too.

NCRoxas commented 1 year ago

I have the same problem and found out if I disable hrsh7th/nvim-cmp the issue goes away. So the issue only appears if nvim-cmp and codeium are both installed.

theoribeiro commented 1 year ago

I have the same problem and found out what triggers it in my case is the following line: https://github.com/Exafunction/codeium.vim/blob/b41b99e8a2c3b4adf0bbbfb59967bc3df1dd3948/autoload/codeium.vim#L127

If I comment it, I have no issues anymore when coming back from Telepresence. However, it does not make any sense to me. Why would redrawstatus trigger a change to insert mode?

fortenforge commented 1 year ago

OK, assuming that the culprit really was that redrawstatus call, I've fixed this by guarding it behind a check to see if the user is actually using GetCodeiumStatus.

If you're experiencing this bug and not using Codeium's status line, please let me know if this fixed the issue.

theoribeiro commented 1 year ago

@fortenforge It seems to have solved on my side. Thanks!

lordvidex commented 1 year ago

I still have this issue. In fact, \<Esc> key does not change the mode from "Insert" to "Normal" when this plugin is installed but somehow, the \<jk> remapping does.

nyngwang commented 1 year ago

notice that: the culprit could also be some plugin to call startinsert.

hmajid2301 commented 1 year ago

I'm also getting this issue until i remove codeium from my statusline.

corintho commented 11 months ago

I was just having this problem today. Buffers were randomly being set into insert mode, mostly after using telescope to navigate. After disabling the lualine configuration to show the status, everything seems to be working as expected