Skip to content

Commit 1e6f331

Browse files
committed
simplify paste
1 parent b2bc4c9 commit 1e6f331

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/textual/widgets/_text_area.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,9 +2225,9 @@ def action_paste(self) -> None:
22252225
"""Paste from local clipboard."""
22262226
if self.read_only:
22272227
return
2228-
clipboard = self.app._clipboard
2229-
start, end = self.selection
2230-
self._replace_via_keyboard(clipboard, start, end)
2228+
clipboard = self.app.clipboard
2229+
if result := self._replace_via_keyboard(clipboard, *self.selection):
2230+
self.move_cursor(result.end_location)
22312231

22322232
def action_delete_to_start_of_line(self) -> None:
22332233
"""Deletes from the cursor location to the start of the line."""

0 commit comments

Comments
 (0)