summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/search.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index d4c1a258..a189ddc4 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -22,22 +22,14 @@ MODE = 'search'
class OpenThreadCommand(Command):
"""open thread in a new buffer"""
- def __init__(self, thread=None, **kwargs):
- """
- :param thread: thread to open (Uses focussed thread if unset)
- :type thread: :class:`~alot.db.Thread`
- """
- self.thread = thread
- Command.__init__(self, **kwargs)
def apply(self, ui):
- if not self.thread:
- self.thread = ui.current_buffer.get_selected_thread()
- if self.thread:
+ thread = ui.current_buffer.get_selected_thread()
+ if thread:
query = ui.current_buffer.querystring
- logging.info('open thread view for %s', self.thread)
+ logging.info('open thread view for %s', thread)
- tb = buffers.ThreadBuffer(ui, self.thread)
+ tb = buffers.ThreadBuffer(ui, thread)
ui.buffer_open(tb)
tb.focus_next_matching(query)