You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should wcwidth provide rjust, ljust, center and textwrap? #93
In the readme, we talk about the example of writing our own custom rjust function. If the most common use case is text alignment, let's just offer it as a public API. They would be the same name and signature as python's,
changed the title [-]Should wcwidth provide rjust, ljust, and center?[/-][+]Should wcwidth provide rjust, ljust, center and textwrap?[/+]on Oct 21, 2023
On textwrap, there is a pretty strange edge-case found in downstream blessed library jquast/blessed#275 -- what should be done when wrapping wide characters to a column length of 1? We have no choice but to flow beyond column width. A width of "1" may not even be allowed, or allowed with caveats.
We must also be very careful not to split ZWJ and VS-16 sequences apart.
Activity
[-]Should wcwidth provide rjust, ljust, and center?[/-][+]Should wcwidth provide rjust, ljust, center and textwrap?[/+]dscrofts commentedon Oct 31, 2023
Definitely! I have implemented the
ljustfunction as per the readme but it would be super convenient to have this already included.jquast commentedon Jun 26, 2024
On textwrap, there is a pretty strange edge-case found in downstream blessed library jquast/blessed#275 -- what should be done when wrapping wide characters to a column length of 1? We have no choice but to flow beyond column width. A width of "1" may not even be allowed, or allowed with caveats.
We must also be very careful not to split ZWJ and VS-16 sequences apart.
jquast commentedon Jan 15, 2026
Proposed as #168, and #169
jquast commentedon Jan 17, 2026
terminal-aware rjust, ljust, center, and wrap merged for next release (0.3.0)