-
-
Notifications
You must be signed in to change notification settings - Fork 362
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(paragraph): Account for Block in Paragraphs line_width, and line_count methods. #1235
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1235 +/- ##
======================================
Coverage 94.5% 94.5%
======================================
Files 65 65
Lines 15136 15276 +140
======================================
+ Hits 14305 14445 +140
Misses 831 831 ☔ View full report in Codecov by Sentry. |
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 - nothing major to be changed. Just some small subjective tidy ups that I'd happily merge without fixing
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.
checks are breaking
I accidentally merged instead of rebasing and made a mess. There is also a missing semi-colon in one of the suggestions. Will clean up things locally and do a push. |
…count methods. Fixes: #1233
Things should be fixed now. Applied the suggestions, and made a few syntax fixes. I think this is good to go. |
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.
Looks great!. Thanks for your contribution :)
…atui#1235) The `line_width`, and `line_count` methods for `Paragraph` would not take into account the `Block` if one was set. This will now correctly calculate the values including the `Block`'s width/height. Fixes: ratatui#1233
Fixes: #1233
The
line_width
, andline_count
methods forParagraph
would not take into account theBlock
if one was set. This will now correctly calculate the values including theBlock
's width/height.The
Blocks
newly implementedhorizontal_space
, andvertical_space
can also be used inBlock::inner
since its mostly duplicate logic. Can add it to this PR or a separate one later. This is also why I decided it would be better to return the results as(top, bottom)
, and(left, right)
since it would allow for use in more areas.