diff options
author | Madhur Garg <madhurgarg96@gmail.com> | 2019-07-04 13:23:48 +0530 |
---|---|---|
committer | Madhur Garg <madhurgarg96@gmail.com> | 2019-08-22 00:54:25 +0530 |
commit | 971c41eac63d2bc298970b1194c0788352a8fd28 (patch) | |
tree | d073b78a5a430c74bfcc284186dadc618c9dea94 | |
parent | 527765e9f6e816d5aee3c078e4fda68bc172bc97 (diff) | |
download | poezio-971c41eac63d2bc298970b1194c0788352a8fd28.tar.gz poezio-971c41eac63d2bc298970b1194c0788352a8fd28.tar.bz2 poezio-971c41eac63d2bc298970b1194c0788352a8fd28.tar.xz poezio-971c41eac63d2bc298970b1194c0788352a8fd28.zip |
Added call to mam_scroll function when page_up is pressed while on the top.
-rw-r--r-- | poezio/tabs/basetabs.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 0732ae73..3921e45c 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -959,7 +959,13 @@ class ChatTab(Tab): return self.text_win.scroll_down(1) def on_scroll_up(self): - return self.text_win.scroll_up(self.text_win.height - 1) + self.text_win.pos += self.text_win.height - 1 + pos = len(self.text_win.built_lines) - self.text_win.height - self.text_win.pos + if pos < 0: + mam.mam_scroll(self) + self.text_win.pos = 0 + else: + return self.text_win.scroll_up(self.text_win.height - 1) def on_scroll_down(self): return self.text_win.scroll_down(self.text_win.height - 1) |