navi icon indicating copy to clipboard operation
navi copied to clipboard

handle Chinese characters

Open cattyhouse opened this issue 2 years ago • 3 comments

if the comment row has Chinese characters, the third row does not align correctly. 2022-04-05 23 24 39

cattyhouse avatar Apr 05 '22 15:04 cattyhouse

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

welcome[bot] avatar Apr 05 '22 15:04 welcome[bot]

I bet the problem is in this line and is related to the fact that chinese characters need more than 1 byte to be represented.

This will also happen if you try using emojis too, I presume.

I need to investigate it

denisidoro avatar Apr 06 '22 21:04 denisidoro

I bet the problem is in this line and is related to the fact that chinese characters need more than 1 byte to be represented.

This will also happen if you try using emojis too, I presume.

I need to investigate it

Many thanks

cattyhouse avatar Apr 07 '22 06:04 cattyhouse

I ran into this issue as well. Looks like format!() is padding it to the correct number of characters, but the problem is that those Chinese characters are simply rendered twice as wide by the terminal. The unicode-width crate can probably help.

mauricelam avatar Jan 05 '23 10:01 mauricelam

Duplicate of #820

denisidoro avatar Apr 08 '23 23:04 denisidoro