fix CJK characters width in output - #1378
Conversation
asottile
left a comment
There was a problem hiding this comment.
could you add a test for this? there are other tests here:
pre-commit/tests/commands/run_test.py
Lines 37 to 90 in 528c7af
another note since I've been looking into the same thing for a text editor, east_asian_width doesn't necessarily indicate how wide the rendered character is, just what that attribute is. there are some characters which on most terminal emulators render wide without having F/W and some which render narrow while having F/W. then there are some terminal emulators which render it differently than other terminal emulators. (there's also zero-width characters to consider as well!)
I'm ok adding this anyway as-is, just that it's still not perfect for all users / characters / use cases (but I agree it's an improvement)
lastly, please continue working in this PR, don't make a new one like the last two -- it's ok to not have everything right in the first push :)

No description provided.