Skip to content
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

Should wcwidth provide rjust, ljust, center and textwrap? #93

Open
jquast opened this issue Oct 21, 2023 · 1 comment
Open

Should wcwidth provide rjust, ljust, center and textwrap? #93

jquast opened this issue Oct 21, 2023 · 1 comment

Comments

@jquast
Copy link
Owner

jquast commented Oct 21, 2023

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,

And text-wrapping interface,

I have previously added support of these (with terminal sequences) in blessed, https://github.com/jquast/blessed/blob/a34c6b1869b4dd467c6d1ab6895872bb72db7e0f/blessed/sequences.py#L141-L239

@jquast jquast changed the title Should wcwidth provide rjust, ljust, and center? Should wcwidth provide rjust, ljust, center and textwrap? Oct 21, 2023
@dscrofts
Copy link

Definitely! I have implemented the ljust function as per the readme but it would be super convenient to have this already included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants