diff --git a/src/textual/content.py b/src/textual/content.py index f895f31804..def09fa5b7 100644 --- a/src/textual/content.py +++ b/src/textual/content.py @@ -1499,6 +1499,8 @@ def highlight_regex( plain = self.plain if isinstance(highlight_regex, str): re_highlight = re.compile(highlight_regex) + else: + re_highlight = highlight_regex count = 0 for match in re_highlight.finditer(plain): start, end = match.span() diff --git a/src/textual/widgets/_text_area.py b/src/textual/widgets/_text_area.py index de072da280..3108b16c32 100644 --- a/src/textual/widgets/_text_area.py +++ b/src/textual/widgets/_text_area.py @@ -446,23 +446,6 @@ class SelectionChanged(Message): def control(self) -> TextArea: return self.text_area - @dataclass - class UserInsert(Message): - """Posted when the user has entered text via the keyboard.""" - - location: Location - """The location where the text was added.""" - - text: str - """The text that was entered.""" - - text_area: TextArea - """The `text_area` that sent this message.""" - - @property - def control(self) -> TextArea: - return self.text_area - def __init__( self, text: str = "", @@ -2443,7 +2426,6 @@ def _replace_via_keyboard( """ if self.read_only: return None - self.post_message(self.UserInsert(start, insert, self)) return self.replace(insert, start, end, maintain_selection_offset=False) def action_delete_left(self) -> None: