diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-11 14:52:43 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-11 14:52:43 +0000 |
commit | f4676a931614ed15dea3059a9a70d269f267813b (patch) | |
tree | f2c1b643762e08693cb8d4632deb78143c632bdb /alot | |
parent | df22d80039908aafdae149a576af93d4ede60a6a (diff) |
more careful removal of thread lines
..from search result after re-tagging this thread
This resolves an issue with nasty warning notifications
Diffstat (limited to 'alot')
-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) |