Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 25, 2024
1 parent a4249b5 commit 92fdedf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/textual/widgets/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,15 @@ def move_cursor(
)

def move_cursor_to_line(self, line: int, animate=False) -> None:
"""Move the cursor to the given line.
Args:
line: The line number (negative indexes are offsets from the last line).
animate: Enable animation.
Raises:
IndexError: If the line doesn't exist.
"""
if line < 0:
line = len(self._tree_lines) + line
try:
Expand Down

0 comments on commit 92fdedf

Please sign in to comment.