summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-06-09 06:10:10 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-06-20 03:09:30 +0530
commit2c4a2d3d010bceacba6c54988d5eed228e671f31 (patch)
treea693e835e4f45f8f514809cca8f96330ed59bee5
parentca72ac8d26d79f0edd620e3d0366166a6c1b768c (diff)
downloadpoezio-2c4a2d3d010bceacba6c54988d5eed228e671f31.tar.gz
poezio-2c4a2d3d010bceacba6c54988d5eed228e671f31.tar.bz2
poezio-2c4a2d3d010bceacba6c54988d5eed228e671f31.tar.xz
poezio-2c4a2d3d010bceacba6c54988d5eed228e671f31.zip
Corrects the repeated refresh of the window
-rw-r--r--poezio/tabs/basetabs.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 0d636c66..1de73052 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -801,20 +801,24 @@ class ChatTab(Tab):
if args[0] == 'end':
self.text_win.scroll_down(len(self.text_win.built_lines))
self.core.refresh_window()
+ return
elif args[0] == 'home':
self.text_win.scroll_up(len(self.text_win.built_lines))
self.core.refresh_window()
+ return
elif args[0] == 'clear':
self._text_buffer.messages = []
self.text_win.rebuild_everything(self._text_buffer)
self.core.refresh_window()
+ return
elif args[0] == 'status':
self.core.information('Total %s lines in this tab.' % len(self.text_win.built_lines), 'Info')
+ return
elif len(args) == 2 and args[0] == 'goto':
for fmt in ('%d %H:%M', '%d %H:%M:%S', '%d:%m %H:%M', '%d:%m %H:%M:%S', '%H:%M', '%H:%M:%S'):
try:
new_date = datetime.strptime(args[1], fmt)
- if 'm' and 'd' in fmt:
+ if 'd' in fmt and 'm' in fmt:
new_date = new_date.replace(year=datetime.now().year)
elif 'd' in fmt:
new_date = new_date.replace(year=datetime.now().year, month=datetime.now().month)
@@ -893,13 +897,11 @@ class ChatTab(Tab):
message_count += 1
if len(self.text_win.built_lines) - self.text_win.height >= len(built_lines):
self.text_win.pos = len(self.text_win.built_lines) - self.text_win.height - len(built_lines) + 1
- self.core.refresh_window()
else:
self.text_win.pos = 0
- self.core.refresh_window()
if message_count == 0:
self.text_win.scroll_up(len(self.text_win.built_lines))
- self.core.refresh_window()
+ self.core.refresh_window()
def on_line_up(self):
return self.text_win.scroll_up(1)