summaryrefslogtreecommitdiff
path: root/alot/widgets/thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/widgets/thread.py')
-rw-r--r--alot/widgets/thread.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index a411e31e..52e23d07 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -439,11 +439,9 @@ class _TextPart(_MIMEPartWidget):
logging.debug('No pygments lexer for MIME type: %s', part.content_type)
# handle git-send-email patches, which are sent as text/plain
- if ('x-mailer' in part.headers and
- part.headers['x-mailer'][0].startswith('git-send-email') and
- '\ndiff' in text):
+ if all(s in text for s in ('\ndiff --git', '\nindex', '\n---', '\n+++')):
try:
- lexer = pygments.lexers.get_lexer_by_name('diff')
+ lexer = pygments.lexers.get_lexer_by_name('diff')
except pygments.util.ClassNotFound:
logging.warning('Could not get a lexer/formatter for diff highlighting')