-
-
Notifications
You must be signed in to change notification settings - Fork 376
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: render of &str and String doesn't respect area.width #1177
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1177 +/- ##
=====================================
Coverage 94.3% 94.3%
=====================================
Files 60 60
Lines 14677 14679 +2
=====================================
+ Hits 13841 13843 +2
Misses 836 836 ☔ View full report in Codecov by Sentry. |
Personally, I'm not a big fan of str implementing Widget. There are many ways to interpret the intent, and it isn't clear what it'll actually do. Because of the way traits show up in rust docs, I'm not sure how to document the behavior. Should a str Widget behave like a Span with no styling? Or a multi-line thing? What if the Str has newlines? Should the rendering word wrap within the area? It would be good to document the answer. If a str Widget is basically a Span with no styling it would be nice to find a way to share more of this implementation with |
I stumbled upon this implementation, and just tried it. Personally I wouldn't have expected it to handle newlines in any way and form. But I agree that the behaviour should be documented.
Probably I looked at that one and wondered why |
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.
This LGTM, don't see reason why we shouldn't have it.
Those two shouldn't write outside the given area I would think.