From 244dbf3a22383be07571f89c680b1aae1253c9a0 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 16 Apr 2021 20:11:13 +0200 Subject: fix: pasting text in data forms and bookmarkstab Fix #3519 --- poezio/tabs/bookmarkstab.py | 2 +- poezio/windows/bookmark_forms.py | 8 ++++---- poezio/windows/data_forms.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poezio/tabs/bookmarkstab.py b/poezio/tabs/bookmarkstab.py index 31902fa6..10c7c0ce 100644 --- a/poezio/tabs/bookmarkstab.py +++ b/poezio/tabs/bookmarkstab.py @@ -116,7 +116,7 @@ class BookmarksTab(Tab): return res self.bookmarks_win.refresh_current_input() else: - self.bookmarks_win.on_input(key) + self.bookmarks_win.on_input(key, raw=raw) def resize(self): self.need_resize = False diff --git a/poezio/windows/bookmark_forms.py b/poezio/windows/bookmark_forms.py index fb8ad589..a7d004d8 100644 --- a/poezio/windows/bookmark_forms.py +++ b/poezio/windows/bookmark_forms.py @@ -62,7 +62,7 @@ class BookmarkMethodInput(FieldInputMixin): # val_pos is the position of the currently selected option self.val_pos = self.options.index(field.method) - def do_command(self, key: str) -> None: + def do_command(self, key: str, raw: bool = False) -> None: if key == 'KEY_LEFT': if self.val_pos > 0: self.val_pos -= 1 @@ -131,7 +131,7 @@ class BookmarkAutojoinWin(FieldInputMixin): self.last_key = 'KEY_RIGHT' self.value = field.autojoin - def do_command(self, key: str) -> None: + def do_command(self, key: str, raw: bool = False) -> None: if key == 'KEY_LEFT' or key == 'KEY_RIGHT': self.value = not self.value self.last_key = key @@ -341,11 +341,11 @@ class BookmarksWin(Win): self.current_horizontal_input].set_color( theme.COLOR_SELECTED_ROW) - def on_input(self, key: str) -> None: + def on_input(self, key: str, raw: bool = False) -> None: if not self.lines: return self.lines[self.current_input][ - self.current_horizontal_input].do_command(key) + self.current_horizontal_input].do_command(key, raw=raw) def refresh(self) -> None: # store the cursor status diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index 7e746774..bdc6cfe1 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -189,7 +189,7 @@ class TextMultiWin(FieldInputMixin): if not self.options or self.options[-1] != '': self.options.append('') else: - self.edition_input.do_command(key) + self.edition_input.do_command(key, raw=raw) self.refresh() def refresh(self): -- cgit v1.2.3