monkoose / neocodeium

free AI completion plugin for neovim
MIT License
205 stars 8 forks source link

add pcall on for vim.version.parse #9

Closed dddyom closed 4 months ago

dddyom commented 4 months ago

Hello! Thanks for the cool plugin. When I open neovim and immediately go into command mode, sometimes the following error appears:

Failed to run `config` for neocodeium
/usr/share/nvim/runtime/lua/vim/version.lua:177: attempt to index local 'version' (a nil value)
# stacktrace:
  - /usr/share/nvim/runtime/lua/vim/version.lua:177 _in_ **parse**
  - /neocodeium/lua/neocodeium/utils/init.lua:112 _in_ **get_neovim_version**
  - /neocodeium/lua/neocodeium/server.lua:238
  - /neocodeium/lua/neocodeium/commands.lua:10
  - /neocodeium/lua/neocodeium/init.lua:147 _in_ **setup**
  - ~/.config/nvim/lua/plugins/coding.lua:252 _in_ **config**

I thought that I could wrap the parsing version in a pcall

P.s.There is another problem not related to this P.R. When I use neocodeium.accept for Cyrillic, some characters are missed, so the word is misspelled. (For example, hllo instead of hello). But this is more complicated than just a pcall))

monkoose commented 4 months ago

Hello.

  1. Can't reproduce, I'm afraid it is your setup
  2. It doesn't fix the problem, just ignores it. But I guess if it cause some problem version of the neovim isn't required for this plugin to work (and some parts converted from official plugin, so I will remove this code a little bit later (maybe this weekends)).

If you have time and willing please creaate new issue about the problem with cyrilllic. And steps to reproduce.

For now I will close this.

monkoose commented 4 months ago

I have removed the code that causes the problem for you cf92cbc48fb4161832f279c55baab3e7539f08d5

dddyom commented 4 months ago

Wow, thank you very much! There really is no problem anymore