From d78792e71e0b4744e93e313255cda197ac417d02 Mon Sep 17 00:00:00 2001 From: Nameless Date: Wed, 21 Apr 2021 14:55:24 +0300 Subject: [PATCH] Move cursor to the correct position for unicode characters when input msg (#212) * Move cursor to the correct position for unicode characters when input msg * Fix black formatting --- tg/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tg/views.py b/tg/views.py index 2703cf8..54fadfb 100644 --- a/tg/views.py +++ b/tg/views.py @@ -116,7 +116,9 @@ class StatusView: line = buff[-(self.w - 1) :] self.win.addstr(0, 0, f"{prefix}{line}") - key = self.win.get_wch(0, min(len(buff + prefix), self.w - 1)) + key = self.win.get_wch( + 0, min(string_len_dwc(buff + prefix), self.w - 1) + ) key = ord(key) if key == 10: # return break