fix(IdeMenu): Use width instead of bytes/chars#998
Conversation
|
I'm fine with this but I always wonder with things like this, should it be width, unicode-width, or graphemes? |
|
@fdncred What's the difference between width and unicode-width? I've only been using For string length, I think the only choices that make sense are bytes, chars, and width. If we care about how wide a string looks visually (in other words, how many columns a string will occupy in the terminal), it must be I don't think number of graphemes is ever useful for anything. Graphemes are good when you want to do something with the individual graphemes rather than the whole string (okay that sounds a little silly and obvious but hopefully you get what I mean) |
|
Ok. Sounds good. |
|
Just to be sure, are you okay with this being merged? (there aren't a lot of people around to approve anyway) |
Fixes #997
We were looking at number of bytes/chars to get the width of the suggestion values and base strings. This didn't work with multibyte characters. The fix is to use the Unicode width of these strings.
This is what the IDE menu looks like with suggestions containing
验(a multibyte character)