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

Use Layout::width instead of calculating for alignment #269

Merged
merged 4 commits into from
Feb 7, 2025
Merged

Conversation

tomcur
Copy link
Member

@tomcur tomcur commented Feb 6, 2025

This does require line breaking to have happened, but that is already a requirement, as otherwise Layout::lines is empty.

This is a slight change in behavior, as trailing white space is no longer included in the alignment width.

Copy link
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to use the already-computed value. But should we be using Layout::width here instead?

@nicoburns nicoburns added this to the 0.3 Release milestone Feb 6, 2025
This does require line breaking to have happened, but that is already a
requirement, as otherwise `Layout::lines` is empty.
@tomcur tomcur changed the title Use Layout::full_width instead of calculating for alignment Use Layout::width instead of calculating for alignment Feb 7, 2025
@tomcur
Copy link
Member Author

tomcur commented Feb 7, 2025

But should we be using Layout::width here instead?

I wondered the same thing, but opened the PR keeping the same behavior. I changed it to Layout::width now – and fixed some more bugs that popped up with overflowing RTL-text.

@tomcur tomcur enabled auto-merge February 7, 2025 10:29
@tomcur tomcur added this pull request to the merge queue Feb 7, 2025
Merged via the queue into main with commit dcb31b2 Feb 7, 2025
21 checks passed
@tomcur tomcur deleted the alignment-width branch February 7, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants