From: Christian Heller Date: Tue, 9 Dec 2025 16:47:58 +0000 (+0100) Subject: Fix misplaced prompt paste inserts. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/decks/template?a=commitdiff_plain;h=5ee1db167f1f102eaba5bedc27695cf785c40c9d;p=ircplom Fix misplaced prompt paste inserts. --- diff --git a/src/ircplom/tui_base.py b/src/ircplom/tui_base.py index 0735109..dbbec08 100644 --- a/src/ircplom/tui_base.py +++ b/src/ircplom/tui_base.py @@ -564,10 +564,10 @@ class PromptWidget(_ScrollableWidget): def insert(self, to_insert: str) -> None: 'Insert into prompt input buffer.' - self._cursor_x += len(to_insert) - self.input_buffer = (self.input_buffer[:self._cursor_x - 1] + self.input_buffer = (_buffer[:self._cursor_x] + to_insert - + self.input_buffer[self._cursor_x - 1:]) + + self.input_buffer[self._cursor_x:]) + self._cursor_x += len(to_insert) self._history_idx_neg = 0 def cmd__backspace(self) -> None: