-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Allow configuring show_nonprintable from PrettyPrinter #2142
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
Conversation
|
Thank you! Looks good to me. Would you mind adding an entry about it to CHANGELOG.md please? |
|
No worries at all! And I've added an entry to the changelog. 👍 |
Co-authored-by: Martin Nordholts <[email protected]>
sharkdp
left a comment
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.
Thank you
I don't think this has been discussed, no. I agree that this should be improved. The "content from READER" part isn't great either 😄. It would be good if you could open a new ticket for this. Thanks! |
|
No worries, I've done so here: #2146 |
This PR allows crates using
batas a library to configure theshow_nonprintablesetting via thePrettyPrinterAPI.Note that it is possible to use
batas a lib and configure this, but the workaround requires usingbat's "inner" API which is discouraged bybat's documentation.Current workaround:
Once this PR is merged, consumers will be able to do this:
Something else noteworthy: if using
batas a library, if binary content is detected then thePrettyPrinterwill print:I'm not sure if this has been discussed previously, but I imagine it could cause some surprise for crates which depend on
batsince the-Aflag obviously isn't available, etc.