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

Properly format lines with big grapheme clusters #3630

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

giacomocavalieri
Copy link
Member

This PR closes #3627
The pretty printer used str.len() as the width of a string; but what a human would intuitively think of as the length of a string is its number of grapheme clusters. This would result in some lines looking short but being split nonetheless by the formatter.

compiler-core/src/pretty.rs Outdated Show resolved Hide resolved
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!!!

@lpil lpil merged commit e5a38f8 into gleam-lang:main Sep 20, 2024
12 checks passed
@giacomocavalieri giacomocavalieri deleted the fix-3627 branch September 20, 2024 14:01
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.

Formatter wraps lines with big grapheme clusters
2 participants