From 71c5a44fdb82f194db17f7ae4759f353fd70c7b2 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 4 May 2023 08:53:24 +0100 Subject: [PATCH] Take Tree.show_root into account when drawing guides Rather than always start at the root, the code should start at the beginning of the path. See #2397. --- src/textual/widgets/_tree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textual/widgets/_tree.py b/src/textual/widgets/_tree.py index 91ffe794e..9d5d9e0d2 100644 --- a/src/textual/widgets/_tree.py +++ b/src/textual/widgets/_tree.py @@ -976,8 +976,8 @@ class Tree(Generic[TreeDataType], ScrollView, can_focus=True): "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.