summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-05-13 16:29:59 +0200
committerAnton Khirnov <anton@khirnov.net>2021-05-13 16:30:22 +0200
commitb7370e42cdc877c39e74e6932b6ae6bf8e1e09f6 (patch)
tree903ee17d46b1e01dc1350e14c20cf3d1f634a9d5
parentec0a3a8406cb34103eb0610c4c8aa3dc330f3c3c (diff)
buffers/thread: do not access message widgets unnecessarily
Avoids constructing the widgets when we only need the messages.
-rw-r--r--alot/buffers/thread.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py
index 33405be4..744eab22 100644
--- a/alot/buffers/thread.py
+++ b/alot/buffers/thread.py
@@ -275,22 +275,22 @@ class ThreadBuffer(Buffer):
raise ValueError('Invalid focus_propery direction: ' + str(direction))
for pos in walk:
- if prop(self._messages[pos].wgt):
+ if prop(self._messages[pos]):
self.set_focus(pos)
break
def focus_next_matching(self, querystring):
"""focus next matching message in depth first order"""
- self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_NEXT)
+ self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_NEXT)
def focus_prev_matching(self, querystring):
"""focus previous matching message in depth first order"""
- self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_PREV)
+ self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_PREV)
def focus_first_matching(self, querystring):
"""focus first matching message in depth first order"""
- self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_FIRST)
+ self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_FIRST)
def focus_last_matching(self, querystring):
"""focus last matching message in depth first order"""
- self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_LAST)
+ self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_LAST)
def focus_thread_widget(self):
"""set focus on the thread widget"""