Temporary solution for incorrect emojies drawing

Some emojies double width but python thinks that it is single so
in result line is shifts to the left and view is not correct.
Need to find out better solution in future
This commit is contained in:
Paul Nameless 2019-02-18 16:32:16 +01:00
parent e3409a2d36
commit 3d69431c39

View file

@ -111,6 +111,8 @@ class ChatView:
self.h = 0 self.h = 0
self.w = 0 self.w = 0
self.win = stdscr.subwin(self.h, self.w, 0, 0) self.win = stdscr.subwin(self.h, self.w, 0, 0)
# self.win.scrollok(True)
# self.win.idlok(True)
def resize(self, p=0.25): def resize(self, p=0.25):
self.h = curses.LINES - 1 self.h = curses.LINES - 1
@ -122,8 +124,8 @@ class ChatView:
# self.win.vline(0, self.w-1, curses.ACS_VLINE, self.h) # self.win.vline(0, self.w-1, curses.ACS_VLINE, self.h)
for i, chat in enumerate(chats): for i, chat in enumerate(chats):
msg = f'{get_date(chat)} {chat["title"]} [{chat["unread_count"]}]: {get_last_msg(chat)}' msg = f'{get_date(chat)} {chat["title"]} [{chat["unread_count"]}]: {get_last_msg(chat)}'
# msg = emoji_pattern.sub(r'', msg)[:self.w-1] msg = emoji_pattern.sub(r'', msg)[:self.w-1]
msg = msg[:self.w-1] # msg = msg[:self.w-1]
if len(msg) < self.w: if len(msg) < self.w:
msg += ' ' * (self.w - len(msg) - 1) msg += ' ' * (self.w - len(msg) - 1)
if i == current: if i == current: