-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
reset height of children #2043
reset height of children #2043
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2043 +/- ##
==========================================
- Coverage 99.49% 99.49% -0.01%
==========================================
Files 73 72 -1
Lines 7361 7337 -24
==========================================
- Hits 7324 7300 -24
Misses 37 37
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Minor docstring change suggested, take it or leave it :)
@@ -25,14 +24,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
- Fix syntax lexer guessing. | |||
- Fixed Pretty measure not respecting expand_all https://github.com/Textualize/rich/issues/1998 | |||
- Collapsed definitions for single-character spinners, to save memory and reduce import time. | |||
- Fix print_json indent type in __init__.py | |||
- Fix print_json indent type in **init**.py |
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.
Not exactly an issue but just curious - is this some markdown formatter thing that caused this?
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.
Yeah, I think that may have been vscode. I need to put it inside backticks.
@@ -224,6 +224,16 @@ def update_height(self, height: int) -> "ConsoleOptions": | |||
options.max_height = options.height = height | |||
return options | |||
|
|||
def reset_height(self) -> "ConsoleOptions": | |||
"""Resets the height to None. |
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.
The docstring makes it sound like the method is doing self.height = None
"""Resets the height to None. | |
"""Returns a copy of the ConsoleOptions with height=None |
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.
Good point.
I had auto-merge on. Feel free to "request changes" if there is a worthwhile change.
Reset height of children in render.
Fix for #2042
When rendering an object with a height, that height is passed to the renderable via options. The problem was that any renderables yielded by
__rich_console__
were passed that same height, which was not intended.This change ensures that height is reset for these sub objects.
Also removes tabulate.py which was marked for deprecation a while ago.