Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Feb 27, 2021
1 parent fa25b28 commit 6219973
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions rich/padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,24 @@ def __rich_console__(
_Segment = Segment

left = _Segment(" " * self.left, style) if self.left else None
right = _Segment(f'{" " * self.right}\n', style)
right = (
[_Segment(f'{" " * self.right}', style), _Segment.line()]
if self.right
else [_Segment.line()]
)
blank_line: Optional[List[Segment]] = None
if self.top:
blank_line = [_Segment(f'{" " * width}\n', style)]
yield from blank_line * self.top
for line in lines:
if left is not None:
if left:
for line in lines:
yield left
yield from line
yield right
yield from line
yield from right
else:
for line in lines:
yield from line
yield from right
if self.bottom:
blank_line = blank_line or [_Segment(f'{" " * width}\n', style)]
yield from blank_line * self.bottom
Expand Down

0 comments on commit 6219973

Please sign in to comment.