Skip to content

Commit f047dc1

Browse files
committed
revert UserInsert message
1 parent fdae5e9 commit f047dc1

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/textual/content.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,8 @@ def highlight_regex(
14991499
plain = self.plain
15001500
if isinstance(highlight_regex, str):
15011501
re_highlight = re.compile(highlight_regex)
1502+
else:
1503+
re_highlight = highlight_regex
15021504
count = 0
15031505
for match in re_highlight.finditer(plain):
15041506
start, end = match.span()

src/textual/widgets/_text_area.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -446,23 +446,6 @@ class SelectionChanged(Message):
446446
def control(self) -> TextArea:
447447
return self.text_area
448448

449-
@dataclass
450-
class UserInsert(Message):
451-
"""Posted when the user has entered text via the keyboard."""
452-
453-
location: Location
454-
"""The location where the text was added."""
455-
456-
text: str
457-
"""The text that was entered."""
458-
459-
text_area: TextArea
460-
"""The `text_area` that sent this message."""
461-
462-
@property
463-
def control(self) -> TextArea:
464-
return self.text_area
465-
466449
def __init__(
467450
self,
468451
text: str = "",
@@ -2443,7 +2426,6 @@ def _replace_via_keyboard(
24432426
"""
24442427
if self.read_only:
24452428
return None
2446-
self.post_message(self.UserInsert(start, insert, self))
24472429
return self.replace(insert, start, end, maintain_selection_offset=False)
24482430

24492431
def action_delete_left(self) -> None:

0 commit comments

Comments
 (0)