-
Notifications
You must be signed in to change notification settings - Fork 36
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
Restore newlines when writing Bstr
s
#161
Conversation
Address @tailhook's feedback in #161 (comment)
I pushed a commit to address @tailhook's feedback. Regarding:
I think this point is perfectly valid, but I also think there are a wide range of heuristics that could be applied. So, assuming this feature is merged, maybe it would be better to let people use it first and see how it behaves on real-world data(?). |
Okay. But I also think NewlineRestorer is a bit more complex than needed. Why not format the same as in the "too many lines" case, but don't omit lines? |
Because I had tunnel vision. :| How's this? |
Looks good, just two tweaks.
But now let maintainers of the repo chime in first. /cc @epage |
@epage Should I implement this? |
Considering we elide output today, I would not consider it a blocker for this but something we can discuss in a new issue. |
Thanks! |
Fixes #137 (cc: @tailhook)
I implemented 6 from #137 (comment), since that seemed to be closest in spirit to the code that was already there.
Note: if a piece of text meets both the "too many lines" and "too many bytes" conditions, the former takes precedence, i.e., I display the text by omitting lines rather than bytes. My reasoning is: if a piece of text meets the "too many lines" condition, it is likely to also meet the "too many bytes" condition. In other words, if you didn't do it this way, this enhancement would almost never apply. The downside to this choice is that it could allow really long lines.