From 77a618a8d599ec31f77b8d3756ba8f1b24c32f8d Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 25 May 2021 19:01:50 +0200 Subject: Fix: do not scroll right by default in dataforms/bookmark text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seeing "…@muc.example.com" instead of "toto@muc.…" is not really helpful, especially in bookmarks. --- poezio/windows/bookmark_forms.py | 6 ++++-- poezio/windows/data_forms.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/poezio/windows/bookmark_forms.py b/poezio/windows/bookmark_forms.py index a7d004d8..a0e57cc7 100644 --- a/poezio/windows/bookmark_forms.py +++ b/poezio/windows/bookmark_forms.py @@ -19,7 +19,8 @@ class BookmarkNameInput(FieldInput, Input): FieldInput.__init__(self, field) Input.__init__(self) self.text = field.name - self.pos = len(self.text) + self.pos = 0 + self.view_pos = 0 self.color = get_theme().COLOR_NORMAL_TEXT def save(self) -> None: @@ -39,7 +40,8 @@ class BookmarkJIDInput(FieldInput, Input): jid = JID('') jid.resource = field.nick or None self.text = jid.full - self.pos = len(self.text) + self.pos = 0 + self.view_pos = 0 self.color = get_theme().COLOR_NORMAL_TEXT def save(self) -> None: diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index bdc6cfe1..1b22aa2c 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -330,7 +330,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): -- cgit v1.2.3