tui line_edit: Set correct cursor position on end

Previously, the cursor would end up one character after the last typed
character when pressing end in the unicode input kitten.
This commit is contained in:
Trygve Aaberge
2020-02-23 11:48:49 +01:00
parent 533a739e2b
commit 6a3eb3f3d7

View File

@@ -103,7 +103,7 @@ class LineEdit:
def end(self): def end(self):
orig = self.cursor_pos orig = self.cursor_pos
self.cursor_pos = wcswidth(self.current_input) + 1 self.cursor_pos = wcswidth(self.current_input)
return self.cursor_pos != orig return self.cursor_pos != orig
def on_key(self, key_event): def on_key(self, key_event):