-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix reflow for CRLF line ending (wip) #2672
Conversation
@kirawi , could you please take a look and let me know if overall approach looks ok? |
This looks good besides the clippy lint. Looks like your PR was merged but isn't released in a version of textwrap yet? mgeisler/textwrap#454 |
@the-mikedavis , I fixed the clippy error. Yes, the change in textwrap is not yet released. |
Yeah this is looking good to me 👍. No need to rush I don't think, it'd be good to have at least one other reviewer check this out before merge anyways |
There has been a Textwrap release now, you should be able to depend on 0.16.0 and get the line-ending control you need. |
I am not sure is this is the right approach. It fixes the common case of CRLF linenedings but actually just exposes a more deeply rooted issue: text-wrap handles line breaks differently then helix. In fact this PR will cause new bugs for crlf files which also contain LF linenedings which are not detected as line breaks at all anymore with this PR. It also fails for other supported (unicode) line-ending and CR line endings. AFAIK the |
I am closing this pr as it has gone stale (over a year without development). Like I said in a different issue we are planning to move away from textwrap and would instead reuese our own softwrap infrastructure in the long run to gain the flexibility to solve issues like this. Thank you for contributing! |
This is a fix for the #2645.
It assumes a fix for the textwrap library, which is already in
master
but not yet released.See details here mgeisler/textwrap#453
Here's a quick demonstration of how it works
https://asciinema.org/a/KZNzsnuHYXppwzw6tvVHyfiSe