ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.96k stars 274 forks source link

fix(examples): changed user_input example to work with multi-byte unicode chars #1069

Closed OkieOth closed 2 months ago

OkieOth commented 2 months ago

This is the proposed solution for issue #1068. It solves the bug in the user_input example with multi-byte UTF-8 characters as input.

joshka commented 2 months ago

I changed this a bit, to instead calculate the byte index and use that to insert. There's still a bug with displaying double width characters however.