-
Notifications
You must be signed in to change notification settings - Fork 10
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
Hangs on ctrl-t with utf-8 input #34
Comments
confirmed. looked at lldb backtraces. what they have in common is linenoiseUtf8NextCharLen.
control-t code was merged which does not work with the new unicode API. So it creates invalid data. So there is 2 bugs here:
and actually 3
|
other functions which make use of buf directly:
I believe both are unicode safe though, I think 0 and l.pos will always be on the boundary of a codepoint. |
The loop is caused by utf8BytesToCodePoint returning 0 on utf-8 invalid text. I'm not sure what the best thing to do in a case like that is. fa0de5c improves the behavior on invalid text, stopping infinite loops. 6d043da fixes the transpose bug for åä and こんにちは. I just realized after pushing that it may not solve the issue when we have more complex clusters(?). |
https://github.com/yhirose/linenoise/tree/utf8-support repo has this same issue. need to contact him. |
Hello,
Linenoise hangs when transposing two utf-8 characters with ctrl-t.
To reproduce, run "make example; ./example" and enter "åä" so your screen looks like this:
Move the cursor to ä (positioning it between å and ä). Press ctrl-t.
The text was updated successfully, but these errors were encountered: