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
This commit is contained in:
Nameless 2021-04-21 14:55:24 +03:00 committed by GitHub
parent 20273fd068
commit d78792e71e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,7 +116,9 @@ class StatusView:
line = buff[-(self.w - 1) :] line = buff[-(self.w - 1) :]
self.win.addstr(0, 0, f"{prefix}{line}") 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) key = ord(key)
if key == 10: # return if key == 10: # return
break break