-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't count invisible characters when calculating column width #1
Comments
It seems to me this is where things get very complicated suddenly. I would think twice whether planning for non-character content is worth it for this module at all. |
writing the following because i want to be sure i'm not missing something obvious @2colours: I've got a lot of experience working with escape characters (see oho ) and this doesn't really seem like a big deal to me. To be clear, i'm not intending to deal with the consequences of things like emoji and anything else that has issues with fitting into a monospace layout because emoji + terminal == layout nightmare. BUT I think invisible content should be pretty straightforward. Well... invisible terminal escape characters should be pretty straightforward. ALL the invisible characters in Unicode, may be another issue. Not sure how many there are like "zero width space". EDIT: looks like it's a pretty small set, if this list is to be trusted. |
It seems to me you explained perfectly why it's a nightmare to work with. :P Besides, terminal escapes are ad-hoc and incompatible with unicode - been there, (not) done that. |
If you include ANSI escape sequences to format your text (bold, colored, etc.) then the code includes those escape characters in the calculation of how wide the text is, but when it's actually displayed those characters are not providing any width, so the columns are all misaligned.
The text was updated successfully, but these errors were encountered: