GH-4: Use erase instead of clear to prevent screen flickering

If using clear the user sees the old screen, then a completely blank screen,
then your new screen. If you use erase then it will instead modify the
old screen to look like the new one.
This commit is contained in:
Paul Nameless 2020-05-03 17:55:32 +08:00
parent dbd3b29b50
commit db02c44596

View file

@ -94,7 +94,7 @@ class StatusView:
def get_input(self):
curses.curs_set(1)
self.win.clear()
self.win.erase()
buff = ''
while True:
@ -144,7 +144,7 @@ class ChatView:
self.win.resize(self.h, self.w)
def draw(self, current, chats):
self.win.clear()
self.win.erase()
# 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)}'
@ -231,7 +231,7 @@ class MsgView:
def draw(self, current, msgs):
# log.info('Dwaring msgs')
self.win.clear()
self.win.erase()
count = self.h
for i, msg in enumerate(msgs):