Skip to content

Commit 98b1040

Browse files
ryneeverettpazz
authored andcommitted
Show currently displayed mime part in status bar.
1 parent c2ed49c commit 98b1040

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

alot/buffers/thread.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def get_info(self):
5656
info['message_count'] = self.message_count
5757
info['thread_tags'] = self.translated_tags_str()
5858
info['intersection_tags'] = self.translated_tags_str(intersection=True)
59+
info['mimetype'] = (
60+
self.get_selected_message().mime_part.get_content_type())
5961
return info
6062

6163
def get_selected_thread(self):

alot/commands/thread.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ def matches(msgt):
600600
elif self.mimepart is True:
601601
mimepart = ui.get_deep_focus().mimepart
602602
mt.set_mimepart(mimepart)
603+
ui.update()
603604
if self.mimetree == 'toggle':
604605
tbuffer.focus_selected_message()
605606
mimetree = not mt.display_mimetree \
@@ -1015,6 +1016,7 @@ class MoveFocusCommand(MoveCommand):
10151016

10161017
def apply(self, ui):
10171018
logging.debug(self.movement)
1019+
original_focus = ui.get_deep_focus()
10181020
tbuffer = ui.current_buffer
10191021
if self.movement == 'parent':
10201022
tbuffer.focus_parent()
@@ -1045,6 +1047,9 @@ def apply(self, ui):
10451047
# TODO add 'next matching' if threadbuffer stores the original query
10461048
# TODO: add next by date..
10471049

1050+
if original_focus != ui.get_deep_focus():
1051+
ui.update()
1052+
10481053

10491054
@registerCommand(MODE, 'select')
10501055
class ThreadSelectCommand(Command):

alot/defaults/alot.rc.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ search_statusbar = mixed_list(string, string, default=list('[{buffer_no}: search
149149
# * `{message_count}`: number of contained messages
150150
# * `{thread_tags}`: displays all tags present in the current thread.
151151
# * `{intersection_tags}`: displays tags common to all messages in the current thread.
152+
# * `{mimetype}`: content type of the mime part displayed in the focused message.
152153

153-
thread_statusbar = mixed_list(string, string, default=list('[{buffer_no}: thread] {subject}','{input_queue} total messages: {total_messages}'))
154+
thread_statusbar = mixed_list(string, string, default=list('[{buffer_no}: thread] {subject}','[{mimetype}] {input_queue} total messages: {total_messages}'))
154155

155156
# Format of the status-bar in taglist mode.
156157
# This is a pair of strings to be left and right aligned in the status-bar.

docs/source/configuration/alotrc_table

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,9 +742,10 @@
742742
* `{message_count}`: number of contained messages
743743
* `{thread_tags}`: displays all tags present in the current thread.
744744
* `{intersection_tags}`: displays tags common to all messages in the current thread.
745+
* `{mimetype}`: content type of the mime part displayed in the focused message.
745746

746747
:type: mixed_list
747-
:default: [{buffer_no}: thread] {subject}, {input_queue} total messages: {total_messages}
748+
:default: [{buffer_no}: thread] {subject}, [{mimetype}] {input_queue} total messages: {total_messages}
748749

749750

750751
.. _thread-subject:

0 commit comments

Comments
 (0)