-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Index out of range when trying to accept suggestions inside comments #344
Comments
I encountered the same error, which in my case appears randomly. It seems that the occurrence of this error is not related to whether I attempt to accept suggestions within or outside of comments. from example, when I am editing a python file on this line: df = pd.read_excel(FILE_NAME, sheet_name='中文字符').d and try to accept the suggestion of "dropna(how='all')" using update: it seems related to the Chinese character I use in the line. When replace them to English characters, the error disappeared. btw, I found the |
I changed the encoding from 'utf-16' to 'utf-8' at line 489 in lua/copilot/suggestion.lua, and it seems to work well now. This change likely resolves the issue. I'm not sure if there is a way to get the actual encoding used in the buffer, I will try to investigate this further. |
This works for me. I'll try to send a pull requset :) change line 489 of lua/copilot/suggestion.lua from
to:
|
the doc says nvim_buf_get_option is deprecated, so I changed to nvim_get_option_value instead:
|
just found this problem is already solved in #336 >_< |
I have encountered a similar problem where an error occurs when the `fileencoding' buffer is empty. This typically happens when opening a new, unsaved file. |
Copilot.lua version: f8d8d87
Neovim: 0.10.2
Error:
The text was updated successfully, but these errors were encountered: