diff options
-rw-r--r-- | alot/commands/search.py | 4 | ||||
-rw-r--r-- | alot/walker.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py index c6f8c266..a7a8c97f 100644 --- a/alot/commands/search.py +++ b/alot/commands/search.py @@ -143,7 +143,9 @@ class TagCommand(Command): thread.get_thread_id()) def remove_thread(): logging.debug('remove thread from result list: %s' % thread) - ui.current_buffer.threadlist.remove(threadline_widget) + threadlist = ui.current_buffer.threadlist + if threadline_widget in threadlist: + threadlist.remove(threadline_widget) ui.current_buffer.result_count -= thread.get_total_messages() def refresh(): diff --git a/alot/walker.py b/alot/walker.py index 47cd9838..516ec7a7 100644 --- a/alot/walker.py +++ b/alot/walker.py @@ -14,6 +14,9 @@ class PipeWalker(urwid.ListWalker): self.focus = 0 self.empty = False + def __contains__(self, name): + return self.lines.__contains__(name) + def get_focus(self): return self._get_at_pos(self.focus) |