diff options
author | Mathieu Pasquet <mathieui@mathieui.net> | 2013-09-19 00:19:42 +0200 |
---|---|---|
committer | Mathieu Pasquet <mathieui@mathieui.net> | 2013-09-19 00:19:42 +0200 |
commit | 40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc (patch) | |
tree | df47646aa7b7086667c4227cf254bba4dffe41ab /src/windows.py | |
parent | b245ff6e2da5eb56e9233ff5bac1d4855e64e949 (diff) | |
download | poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.gz poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.bz2 poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.xz poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.zip |
Fix #2372 (traceback on space in roster after disconnect)
selected_row wasn’t reset
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py index 551f20af..5e14c3d4 100644 --- a/src/windows.py +++ b/src/windows.py @@ -2007,6 +2007,8 @@ class RosterWin(Win): with g_lock: # make sure we are within bounds self.move_cursor_up((self.roster_len + self.pos) if self.pos >= self.roster_len else 0) + if not self.roster_cache: + self.selected_row = None self._win.erase() self._win.move(0, 0) self.draw_roster_information(roster) @@ -2016,8 +2018,9 @@ class RosterWin(Win): if self.start_pos+self.height <= self.pos+2: self.scroll_down(self.pos - self.start_pos - self.height + (self.height//2)) # draw the roster from the cache - for item in self.roster_cache[self.start_pos-1:self.start_pos+self.height]: + roster_view = self.roster_cache[self.start_pos-1:self.start_pos+self.height] + for item in roster_view: draw_selected = False if y -2 + self.start_pos == self.pos: draw_selected = True |