textview->is_in_signature = FALSE;
textview->is_diff = FALSE;
textview->is_attachment = FALSE;;
+ textview->is_in_git_patch = FALSE;
procmime_decode_content(mimeinfo);
}
if (prefs_common.enable_color) {
- if (textview->is_diff) {
+ if (textview->is_diff || textview->is_in_git_patch) {
if (strncmp(buf, "+++ ", 4) == 0)
fg_color = "diff-add-file";
else if (buf[0] == '+')
else if (buf[0] == '-')
fg_color = "diff-del";
else if (strncmp(buf, "@@ ", 3) == 0 &&
- strcmp(buf+strlen(buf)-4, " @@\n") == 0)
+ strstr(&buf[3], " @@"))
fg_color = "diff-hunk";
- } else if (account_sigsep_matchlist_str_found(buf,"%s\n")
+
+ if (account_signatures_matchlist_nchar_found(buf, "%s\n")
+ textview->is_in_git_patch = FALSE;
+ textview->is_in_signature = TRUE;
+ fg_color = "signature";
+ }
+ } else if (account_sigsep_matchlist_str_found(buf, "%s\n")
|| account_sigsep_matchlist_str_found(buf, "- %s\n")
|| textview->is_in_signature) {
fg_color = "signature";
textview->is_in_signature = TRUE;
+ } else if (strncmp(buf, "diff --git ", 11) == 0) {
+ textview->is_in_git_patch = TRUE;
}
}