Skip to content

Commit

Permalink
Add a docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Dec 17, 2024
1 parent 5edcab0 commit cfe93cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,11 @@ def matching_bracket_location(self) -> Location | None:

@contextmanager
def cursor_scroll_disabled(self) -> Generator[None, None, None]:
"""Temporarily disable the automatic scrolling of the cursor into view.
By default, the cursor will always scroll into view when it's moved, unless
the code which performs that movement is called inside this context manager.
"""
self._scroll_cursor_visible = False
yield
self._scroll_cursor_visible = True
Expand Down

0 comments on commit cfe93cb

Please sign in to comment.