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: port breakLines to wrap-ansi #1106
Conversation
8640d55
to
d5a8d29
Compare
This PR addresses incorrect line wrapping with `terminal-link`. It does so by employing the `wrap-ansi` npm. Fixes SBoudrias#1014 Fixes SBoudrias#304
Thanks for sending a PR; this looks very promising. We'll need the |
Codecov Report
@@ Coverage Diff @@
## master #1106 +/- ##
==========================================
- Coverage 88.30% 88.16% -0.14%
==========================================
Files 4 4
Lines 171 169 -2
Branches 23 22 -1
==========================================
- Hits 151 149 -2
Misses 1 1
Partials 19 19
Continue to review full report at Codecov.
|
Would you mind also addressing the new screen manager located at |
- move wrapAnsi dependence out of the top-level
Thanks for the great feedback. I have made the requested changes. Let me know if you need me to squash the commits. Unsure of your preference, I left them unsquashed for now. |
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.
LGTM!
One extra thing if you have some time and don't mind, it'd be great to include a demo with terminal-link. I think it'll be hard to write an automated test; so at least a demo would help validate and caught regression when doing manual checks pre-releases.
Sure, i'll add an example. I'll have to use terminal@2, since terminal@latest is ESM-only. |
Awesome! Thanks a ton for following through with everything 🎉 |
[This PR](SBoudrias#1106) updated `breakLines` to use `wrap-ansi`. However, in doing so, we broke the paginator. It assumes that the return value will be of the same length as the original array, but that broken lines will be subarrays.
[This PR](#1106) updated `breakLines` to use `wrap-ansi`. However, in doing so, we broke the paginator. It assumes that the return value will be of the same length as the original array, but that broken lines will be subarrays.
This PR addresses incorrect line wrapping with
terminal-link
. It does so by employing thewrap-ansi
npm.Fixes #1014
Fixes #304
To the reviewers: I wasn't sure whether we should pass the hard option to
wrap-ansi
:If inquirer needs hard wrapping (in which case I assume wrap-ansi may split long words at arbitrary points in order to avoid overflow), we can easily add that to this PR.