-
-
Notifications
You must be signed in to change notification settings - Fork 101
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 argparse linewrap for R| strings #2685
Conversation
This prevents lines being broken within words when using R| at the beginning of an argparse help string
i tried de580da with
|
hmm that's the output I get before the PR, but it's fixed in de580da for me. Could it be a mac thing? |
Yeah that's what i thought... let me try from within docker |
i confirm this is likely a mac thing... in ubuntu (via docker), using the same terminal size, i get the proper word break:
|
but regardless, it would be nice to have the text aligned with "<point,FILE>" (which is the case when we do not use "R|"). Do you think that would be possible without too much pain? |
I can think of a pretty rough solution. Just match any number of tabs and spaces in the previous line and insert it in all following lines. I'll see if it works. |
A more heavyweight solution that computes offsets for the paragraph and appends that offset to following lines. Requires an additional wrapping step compute the new wrap after the offset is added.
I think I have a working solution. Not sure what to do about the mac issue. Do we think it's using |
no idea... |
I just tested the updated 3534859 on OSX 10.14 and I get the same output as @alexfoias here, so it looks like your fix fixed it @cfhammill 🥇 |
Great, thanks @alexfoias and @jcohenadad. This is ready for review/merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @cfhammill !
This prevents lines being broken within words when using R| at the beginning of an argparse help string
Useful for #2658