mirror of
https://github.com/paul-nameless/tg
synced 2024-11-22 03:43:19 +00:00
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:
parent
e3409a2d36
commit
3d69431c39
1 changed files with 4 additions and 2 deletions
6
view.py
6
view.py
|
@ -111,6 +111,8 @@ class ChatView:
|
|||
self.h = 0
|
||||
self.w = 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):
|
||||
self.h = curses.LINES - 1
|
||||
|
@ -122,8 +124,8 @@ class ChatView:
|
|||
# self.win.vline(0, self.w-1, curses.ACS_VLINE, self.h)
|
||||
for i, chat in enumerate(chats):
|
||||
msg = f'{get_date(chat)} {chat["title"]} [{chat["unread_count"]}]: {get_last_msg(chat)}'
|
||||
# msg = emoji_pattern.sub(r'', msg)[:self.w-1]
|
||||
msg = msg[:self.w-1]
|
||||
msg = emoji_pattern.sub(r'', msg)[:self.w-1]
|
||||
# msg = msg[:self.w-1]
|
||||
if len(msg) < self.w:
|
||||
msg += ' ' * (self.w - len(msg) - 1)
|
||||
if i == current:
|
||||
|
|
Loading…
Reference in a new issue