-
Notifications
You must be signed in to change notification settings - Fork 394
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
VimTex info error #2849
Comments
I've tried to fix this. Can you update to the latest version and try again and let me know how it goes? I don't expect the output to be perfect here, but I hope that it looks good enough and that there is no error. |
Same error but now a different string
<a0>rio probably refers to "Usuário", translations for "User" |
Line 4 of
annoyingly the following functions's names are not displayed by vim, so I can't tell which function the following line 4 and line 6 is of. Neither can I tell you're using persistent or temporary cache. (persistent is the default.) Try typing
and read the content of the JSON file at the output, see what's the content. Edit: I didn't realize earlier, but the error is caused by neovim trying to store the string into the JSON file. https://github.com/neovim/neovim/blob/1cf51a07a6bfb827efc36911cd018da3a3cb863b/src/nvim/eval/encode.c#L633 |
I'm also annoyed by this fact, although I've become quite adapt at recognizing functions from script numbers and similar. |
Ok, it seems I was onto something, but I'm not quite sure. And it's hard, because I can't really reproduce this properly. Not sure how to properly catch all of this without somehow writing a full windows-1252 to utf-8 converter... |
Oh, and I would also need to properly detect the encoding. These things are hard. |
Some quick testing:
seems to work well enough at displaying the function name. Could anything go wrong? Edit: perhaps |
That code looks... strange (and without much rationale what's going on). Is it just that if Then the next question is, why would Edit: I didn't realize earlier, but neovim throws this error while trying to store such a string in JSON Another thing, the code doesn't look like valid Windows-1252 either.
and neither is it valid UTF-8. The word |
Sorry, but I don't see quite how this is relevant. The problem here seems related to the encoding of strings passed as arguments to functions. In particular, Vimscript (perhaps also valid for Lua code in neovim) relies on UTF-8 encoded strings and will raise an error if it is somehow passed a string with bytecodes that are not valid UTF-8 bytecodes. I may have understood things wrong, though.
I should probably write a comment here to explain!
Yes, exactly.
Because I'm slightly inclined to just ignore it, but at the same time I feel it should be possible to find a relatively simple solution here.
Oh, nice! Thanks for going deeper! It seems obvious now that I should have checked the source code for this error message!
I agree to this. When debugging, I also found it did not seem to look right when decoded as windows-1252. So it is possible I'm wrong about the source encoding here. But I think the end result is that I need to somehow remove or convert bytes in some byterange to avoid this error.
Perhaps the problematic bytecode is a result of parsing only part of some sequence, thus that the original code has some starting part swallowed before the error appears? |
But OK, the problem is clearly related to vimtex/autoload/vimtex/cache.vim Line 218 in e7ce03e
|
Could you run Also; could you run I believe it should report CP-1252 or something like that. This will be useful input to learn how to properly fix this issue. In the meantime, You can overcome the error by making a cache file with prefilled data. You can do that like this:
|
It's really there. E474 refers to "Versão do sistema operacional (OS version)" and E474 refers to "Proprietário registrado (registered owner)
It worked with the following message:
|
For the first part, I mean that if the code is rewritten to avoid numbered-function, then the traceback in the log will contain the name of the function. (admittedly the code looks a little more ugly that way.) |
Ah, ok. Yes, I agree it is annoying that the name of the function is missing in the log output. But the numbers are helpful, and the line numbers make it possible to trace things correctly. |
Ok, so, returning to this - I'm not fully sure how to continue. It is clear that we have a problem related to encoding combined with |
I've reverted my earlier attempt at a fix, because I can't properly ensure it is correct. However, I've added a check for the problem to avoid the initial error. @rafaelferracini Can you help me by testing the latest version? These steps:
|
@hrcHarry I would be happy if you could also test similar to how I asked of Rafael above. |
Hi @lervag The result of testing is as follows
|
Thanks! Does this mean that you now get this error message everytime you do |
Hi @lervag The error message appears every time I open a new terminal executing nvim (.tex file) and doing |
Ok, this is as expected. I believe it is an improvement from earlier, where there would still be an error, but the info window would not appear. I'm sorry to say that I don't know how to better solve this issue. The problem has to do with your locale, which, for some reason, is not standard UTF-8. If you're able to change this in your Windows environment, then I think you won't get that error. |
I'm closing the issue as I don't know how else to proceed here. |
Description
I've just installed VimTex in my Neovim environment (configured with Lua and Packer), and to check if the installation went well, I executed :VimtexInfo.
I believe it might be due to my computer's language settings (Portuguese-BR), but I can't change it due to Windows limitations.
Here's the error:
The text was updated successfully, but these errors were encountered: