Skip to content

Commit 9267703

Browse files
committed
read only cursor
1 parent 2af8f90 commit 9267703

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717
- Widget.release_mouse will now only release the mouse, if it was captured by self https://github.com/Textualize/textual/pull/5900
1818
- Some optimizations to TextArea, which may be noticeable during scrolling (note: may break snapshots with a TextArea) https://github.com/Textualize/textual/pull/5925
1919
- Selecting in the TextArea now hides the cursor until you release the mouse https://github.com/Textualize/textual/pull/5925
20+
- Read only TextAreas will no longer display a cursor https://github.com/Textualize/textual/pull/5925
2021

2122
## Added
2223

src/textual/widgets/_text_area.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ def render_line(self, y: int) -> Strip:
11571157
self.match_cursor_bracket,
11581158
self.soft_wrap,
11591159
self.show_line_numbers,
1160+
self.read_only,
11601161
)
11611162
if (cached_line := self._line_cache.get(cache_key)) is not None:
11621163
return cached_line
@@ -1278,6 +1279,7 @@ def _render_line(self, y: int) -> Strip:
12781279
self.has_focus
12791280
and not self.cursor_blink
12801281
or (self.cursor_blink and self._cursor_visible)
1282+
and not self.read_only
12811283
)
12821284
if draw_matched_brackets:
12831285
matching_bracket_style = theme.bracket_matching_style if theme else None

0 commit comments

Comments
 (0)