Skip to content

Commit

Permalink
fix: optional newline support for tree children
Browse files Browse the repository at this point in the history
  • Loading branch information
0zitro committed Dec 9, 2024
1 parent 65c7e37 commit 909f844
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rich/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ def make_guide(index: int, style: Style) -> Segment:
post_style=remove_guide_styles,
)
yield from line
if self.end_new_line:

# Equivalent of `if not last or (depth == 0) or (depth != 0 and self.end_new_line):`
if not last or depth == 0 or self.end_new_line:
yield new_line

if first and prefix:
prefix[-1] = make_guide(
SPACE if last else CONTINUE, prefix[-1].style or null_style
Expand Down

0 comments on commit 909f844

Please sign in to comment.