summaryrefslogtreecommitdiff
path: root/alot/widgets
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-17 13:19:01 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-17 13:19:01 +0100
commit60107e18edacf4a53a66145a3888d394746a8a1d (patch)
tree62e7fd1cacbdae24e555035009db911f6c4442e2 /alot/widgets
parent8f0f494ab0e621573eb6f941663891119b5c555b (diff)
widgets/thread: colorize text/x-{diff,patch} as patches
Diffstat (limited to 'alot/widgets')
-rw-r--r--alot/widgets/thread.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index 8f07432e..a1512679 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -263,8 +263,9 @@ class _TextPart(_MIMEPartWidget):
# FIXME this is quite ad-hoc
# make it more configurable, detect other patch formats
# and possibly other kinds of text
- if ('x-mailer' in part.headers and
- part.headers['x-mailer'][0].startswith('git-send-email')):
+ if (('x-mailer' in part.headers and
+ part.headers['x-mailer'][0].startswith('git-send-email')) or
+ part.content_type in ('text/x-diff', 'text/x-patch')):
# process as patch
if have_pygments:
try: