-
Notifications
You must be signed in to change notification settings - Fork 123
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
replace_termcodes with DecodeHook fails on non-ASCII input #52
Comments
Ahhh, it actually makes some sense that replace_termcodes would return invalid strings. The returned value is the internally representation Vim uses, i.e. there may be some escaping going around. Quick fix is to call replace_termcodes from a session without DecodeHook. The "right way(TM)" is to have replace_termcodes return a new Binary type that is not treated as a decodable string. |
Can't that be done with another SessionHook? For example, see how the ScriptHost class uses a hook to emulate the legacy behavior of |
@tarruda Yes, I created a pull request google/vroom#78 that keeps two Nvim objects one with and one without the DecodeHook. Seems to work as intended. |
Sounds fine as a workaround. Is it possible to make this less brittle? I don't understand where the decoding problem arises, but it seems like python should have enough context to DTRT. |
Possible yes, but not on the short run. As DTRT goes, |
With the latest changes we could change replace_termcodes to always return |
using->location
vim.replace_termcodes
seems to be broken when used on a vim client with a neovim.DecodeHook installed. It seems like it might be trying to double-decode input or something.An example from maktaba:
I tried some other variations of passing pre-encoded bytes and such, and couldn't find anything that wouldn't blow up.
It would also be good to get unicode strings out at least when passing unicode strings in.
The text was updated successfully, but these errors were encountered: