diff options
Diffstat (limited to 'poezio/windows/data_forms.py')
-rw-r--r-- | poezio/windows/data_forms.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index 7e746774..db174703 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -6,6 +6,7 @@ does not inherit from the Win base class), as it will create the others when needed. """ +from typing import Type from poezio.windows import base_wins from poezio.windows.base_wins import Win from poezio.windows.inputs import Input @@ -189,7 +190,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): @@ -330,7 +331,8 @@ class TextSingleWin(FieldInputMixin, Input): Input.__init__(self) self.text = field.get_value() if isinstance(field.get_value(), str)\ else "" - self.pos = len(self.text) + self.pos = 0 + self.view_pos = 0 self.color = get_theme().COLOR_NORMAL_TEXT def reply(self): @@ -396,10 +398,10 @@ class FormWin: for (name, field) in self._form.getFields().items(): if field['type'] == 'hidden': continue - try: + if field['type'] not in self.input_classes: + input_class: Type[FieldInputMixin] = TextSingleWin + else: input_class = self.input_classes[field['type']] - except IndexError: - continue label = field['label'] desc = field['desc'] if field['type'] == 'fixed': |