From e53dd26c5896f4d48a878a1d146be1c706fb4b1e Mon Sep 17 00:00:00 2001 From: haliphax Date: Sat, 6 Feb 2021 23:29:19 -0600 Subject: [PATCH] fix edge of line editor --- xthulu/ui/editors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xthulu/ui/editors.py b/xthulu/ui/editors.py index bf40529..2b9d5f7 100644 --- a/xthulu/ui/editors.py +++ b/xthulu/ui/editors.py @@ -183,8 +183,10 @@ def process_keystroke(self, ks): self.value[self.pos[0]] = before + ucs + after self.pos[1] += 1 + move_left = len(after) if self.pos[1] < len(self.value[self.pos[0]]) \ + else len(after) - 1 - return self._color(ucs + after + self.term.move_left(len(after))) + return self._color(ucs + after + self.term.move_left(move_left)) class LineEditor(BlockEditor):