jrnxf / thokr

✨ sleek typing tui with visualized results and historical logging
MIT License
519 stars 18 forks source link

Multi-byte codepoints cause panic #16

Closed bluelhf closed 1 year ago

bluelhf commented 1 year ago

Description

When a multiple-byte codepoint is rendered in the prompt, thokr panics and dies.

To Reproduce

Run thokr -p "ä" Observe the panic.

Expected behavior

Thokr should render the character properly, without panicking.

Environment

Additional context

I suspect the source of the panic can be found on line 64 in thok.rs. https://github.com/thatvegandev/thokr/blob/9453468032cae753570b660146103abd55609df2/src/thok.rs#L64

bluelhf commented 1 year ago

Ah, I see you actually have mentioned this in the README. What kinds of rendering issues did characters with diacritics previously cause?

jrnxf commented 1 year ago

It's been a while but I seem to remember the error being that you simply would be blocked entirely unless you were able to type the character in one keypress. I also remember having issues regarding the actual space a special character (eg one with diacritics) takes up, causing some issues with strings. I don't have the bandwidth to work on this right now, so I'm going to close the ticket, but this is personally the issue I'd like to see resolved the most if anyone has any ideas!