From 775165ec1224c68a1716411c129cd97e71d76f5f Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Tue, 31 Jan 2023 12:48:19 +0000 Subject: [PATCH] Add a docstring to action_toggle_node I want to add docstrings to the actions I'm adding as part of #1700, so with this in mind I'm going to add docstrings to all the actions. --- src/textual/widgets/_tree.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/textual/widgets/_tree.py b/src/textual/widgets/_tree.py index b3d85cf6a..5a3e0939b 100644 --- a/src/textual/widgets/_tree.py +++ b/src/textual/widgets/_tree.py @@ -1015,6 +1015,13 @@ class Tree(Generic[TreeDataType], ScrollView, can_focus=True): self._toggle_node(line.path[-1]) def action_select_cursor(self) -> None: + """Cause a select event for the target node. + + Note: + If `auto_expand` is `True` use of this action on a non-leaf node + will cause both an expand/collapse event to occour, as well as a + selected event. + """ try: line = self._tree_lines[self.cursor_line] except IndexError: