Skip to content

Commit

Permalink
Take Tree.show_root into account when drawing guides
Browse files Browse the repository at this point in the history
Rather than always start at the root, the code should start at the beginning
of the path.

See Textualize#2397.
  • Loading branch information
davep committed May 4, 2023
1 parent 90d9693 commit 71c5a44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/textual/widgets/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ def _render_line(self, y: int, x1: int, x2: int, base_style: Style) -> Strip:
"tree--guides-selected", partial=True
)

hover = self.root._hover
selected = self.root._selected and self.has_focus
hover = line.path[0]._hover
selected = line.path[0]._selected and self.has_focus

def get_guides(style: Style) -> tuple[str, str, str, str]:
"""Get the guide strings for a given style.
Expand Down

0 comments on commit 71c5a44

Please sign in to comment.