summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/windows.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/windows.py b/src/windows.py
index fae2e7bb..e8f4ce8f 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -239,8 +239,10 @@ class UserList(Win):
y = 0
users = sorted(users)
- if self.pos >= len(users) and self.pos != 0:
- self.pos = len(users)-1
+ if len(users) < self.height:
+ self.pos = 0
+ elif self.pos >= len(users) - self.height and self.pos != 0:
+ self.pos = len(users) - self.height
for user in users[self.pos:]:
self.draw_role_affiliation(y, user)
self.draw_status_chatstate(y, user)