summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2013-02-02 11:26:02 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2013-03-03 13:48:21 +0000
commitdb460d710385aed2eaa879ec19517562297af9ca (patch)
tree6a76cb97a0a58e477a9413604ef442277365b5d9 /alot
parent6b8898b7c223505ace962aec26e168ac429dfd92 (diff)
re-implement unfold-if-matching feature
Diffstat (limited to 'alot')
-rw-r--r--alot/buffers.py8
-rw-r--r--alot/commands/thread.py2
m---------alot/foreign/urwidtrees0
-rw-r--r--alot/widgets/thread.py3
4 files changed, 9 insertions, 4 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 47dcad16..e07875ce 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -332,7 +332,7 @@ class ThreadBuffer(Buffer):
arrow_tip_att=heads_att,
arrow_att=bars_att,
)
- self._nested_tree =NestedTree(A, interpret_covered=True)
+ self._nested_tree = NestedTree(A, interpret_covered=True)
self.body = TreeBox(self._nested_tree)
self.message_count = self.thread.get_total_messages()
@@ -401,20 +401,20 @@ class ThreadBuffer(Buffer):
:param focus_first: set the focus to the first matching message
:type focus_first: bool
"""
- return
first = None
for MT in self.messagetrees():
msg = MT._message
if msg.matches(querystring):
MT.expand(MT.root)
if first is None:
- logging.debug('BODY %s' % self.body)
- self.body.set_focus((pos, MT.root))
+ first = (self._tree.position_of_messagetree(MT), MT.root)
+ self.body.set_focus(first)
if 'unread' in msg.get_tags():
msg.remove_tags(['unread'])
self.ui.apply_command(commands.globals.FlushCommand())
else:
MT.collapse(MT.root)
+ self.body.refresh()
class TagListBuffer(Buffer):
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index 838d5737..99ef76b7 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -853,6 +853,8 @@ class MoveFocusCommand(Command):
tbox.focus_next()
elif self._direction == 'previous':
tbox.focus_prev()
+ # TODO add 'next matching' if threadbuffer stores the original query string
+ # TODO: add next by date..
tbox.refresh()
@registerCommand(MODE, 'select')
diff --git a/alot/foreign/urwidtrees b/alot/foreign/urwidtrees
-Subproject ab8d90113f0c70455c90ea45db4bcc0ac02678a
+Subproject 58382145f8c1c27cffe45406f98a24e4de039b6
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index 89623552..2538656d 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -387,3 +387,6 @@ class ThreadTree(Tree):
def prev_sibling_position(self, pos):
return self._prev_sibling_of.get(pos, None)
+
+ def position_of_messagetree(self, mt):
+ return mt._message.get_message_id()