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

Incorrect computation of line width with multibyte characters #577

Open
echasnovski opened this issue Sep 16, 2022 · 2 comments
Open

Incorrect computation of line width with multibyte characters #577

echasnovski opened this issue Sep 16, 2022 · 2 comments
Labels
bug Something isn't working hard Issue is difficult to solve

Comments

@echasnovski
Copy link

  1. Create a file with line string.rep("ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы", 10).
  2. Run stylua with default config on that file. It results into multi line function call, but line width is only 70 characters, but 122 bytes.

Version: 0.14.3.

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Sep 16, 2022
@JohnnyMorganz
Copy link
Owner

Wherever we do .len() on a string we should probably compute graphemes. Will probably need to bring in an external crate for this

@echasnovski
Copy link
Author

Yeah... I feel you. Multibyte characters are a constant source of trouble.

@JohnnyMorganz JohnnyMorganz added the hard Issue is difficult to solve label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hard Issue is difficult to solve
Projects
None yet
Development

No branches or pull requests

2 participants