Skip to content

Commit f740ff7

Browse files
author
Felix Van der Jeugt
committed
add prevctype command
1 parent 93e51ae commit f740ff7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

alot/commands/thread.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,3 +1208,16 @@ def apply(self, ui):
12081208
message_tree.next_contenttype()
12091209
message_tree.reassemble()
12101210
tbuffer.refresh()
1211+
1212+
@registerCommand(MODE, 'prevctype', help='display the previous contenttype')
1213+
class PrevCTypeCommand(Command):
1214+
1215+
"""display the next contenttype"""
1216+
repeatable = True
1217+
1218+
def apply(self, ui):
1219+
tbuffer = ui.current_buffer
1220+
message_tree = tbuffer.get_selected_messagetree()
1221+
message_tree.prev_contenttype()
1222+
message_tree.reassemble()
1223+
tbuffer.refresh()

alot/widgets/thread.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ def next_contenttype(self):
290290
self._current_contenttype += 1
291291
self._current_contenttype %= len(self._get_content_parts())
292292

293+
def prev_contenttype(self):
294+
self._current_contenttype -= 1
295+
self._current_contenttype %= len(self._get_content_parts())
296+
293297
def _get_headers(self):
294298
if self.display_all_headers is True:
295299
if self._all_headers_tree is None:

0 commit comments

Comments
 (0)