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

Move away from string::len for computing the length of a line #3235

Closed
2 tasks done
scampi opened this issue Dec 7, 2018 · 3 comments
Closed
2 tasks done

Move away from string::len for computing the length of a line #3235

scampi opened this issue Dec 7, 2018 · 3 comments

Comments

@scampi
Copy link
Contributor

scampi commented Dec 7, 2018

In #3224 the computation of the line length was errored because it relied on String::len, which ultimately had negative impact on the comment refactoring. This issue is to track the places where that needs to be fixed.
This list may be extended as additional places that need fixing are found:

  • the wrap_str method
  • the rewrite_comment method
@wada314
Copy link
Contributor

wada314 commented Dec 25, 2018

Hello, I'm interested in this line length problem because I'm a CJK language user.
If no one has started to work on this, can I try work for fixing this str::len issue in this EOY holiday season?
I'm assuming I just need to replace str::len with the crate unicode_width's methods, there's no complications.

If possible I also want to add a rustfmt option to switch the treating of "ambiguous characters" (UAX#11 4.2), but that seems to be bit hard work because I need to drag around the Config struct everywhere calling wrap_str and rewrite_comment, so that should be low-priority.

@nrc
Copy link
Member

nrc commented Jan 7, 2019

If no one has started to work on this, can I try work for fixing this str::len issue in this EOY holiday season?

That would be great, thank you!

I'm assuming I just need to replace str::len with the crate unicode_width's methods, there's no complications.

I would start this way. It might cause complications or not be sufficient, but it will need doing.

@scampi
Copy link
Contributor Author

scampi commented Jun 10, 2019

duplicate of #6

@scampi scampi closed this as completed Jun 10, 2019
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

No branches or pull requests

3 participants