int ColorDefs[MT_COLOR_MAX];
COLOR_LINE *ColorHdrList = NULL;
COLOR_LINE *ColorBodyList = NULL;
+COLOR_LINE *ColorStatusList = NULL;
COLOR_LINE *ColorIndexList = NULL;
+ COLOR_LINE *ColorIndexAuthorList = NULL;
+ COLOR_LINE *ColorIndexFlagsList = NULL;
+ COLOR_LINE *ColorIndexSubjectList = NULL;
/* local to this file */
static int ColorQuoteSize;
{ "bold", MT_COLOR_BOLD },
{ "underline", MT_COLOR_UNDERLINE },
{ "index", MT_COLOR_INDEX },
+ { "progress", MT_COLOR_PROGRESS },
+ { "index_author", MT_COLOR_INDEX_AUTHOR },
+ { "index_collapsed", MT_COLOR_INDEX_COLLAPSED },
+ { "index_date", MT_COLOR_INDEX_DATE },
+ { "index_flags", MT_COLOR_INDEX_FLAGS },
+ { "index_label", MT_COLOR_INDEX_LABEL },
+ { "index_number", MT_COLOR_INDEX_NUMBER },
+ { "index_size", MT_COLOR_INDEX_SIZE },
+ { "index_subject", MT_COLOR_INDEX_SUBJECT },
{ "prompt", MT_COLOR_PROMPT },
#ifdef USE_SIDEBAR
{ "sidebar_divider", MT_COLOR_DIVIDER },
#endif
if (object == MT_COLOR_HEADER)
- r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err,0);
+ r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err, 0, match);
else if (object == MT_COLOR_BODY)
- r = add_pattern (&ColorBodyList, buf->data, 1, fg, bg, attr, err, 0);
+ r = add_pattern (&ColorBodyList, buf->data, 1, fg, bg, attr, err, 0, match);
+ else if ((object == MT_COLOR_STATUS) && MoreArgs (s)) {
- /* 'color status fg bg' can have upto 2 arguments:
++ /* 'color status fg bg' can have up to 2 arguments:
+ * 0 arguments: sets the default status color (handled below by else part)
+ * 1 argument : colorize pattern on match
+ * 2 arguments: colorize nth submatch of pattern
+ */
+ mutt_extract_token (buf, s, 0);
+
+ if (MoreArgs (s)) {
+ BUFFER temporary;
+ memset (&temporary, 0, sizeof (BUFFER));
+ mutt_extract_token (&temporary, s, 0);
+ match = atoi (temporary.data);
+ FREE(&temporary.data);
+ }
+
+ if (MoreArgs (s)) {
+ strfcpy (err->data, _("too many arguments"), err->dsize);
+ return -1;
+ }
+
+ r = add_pattern (&ColorStatusList, buf->data, 1,
+ fg, bg, attr, err, 0, match);
+ }
else if (object == MT_COLOR_INDEX)
{
- r = add_pattern (&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1);
+ r = add_pattern (&ColorIndexList, buf->data, 1,
+ fg, bg, attr, err, 1, match);
set_option (OPTFORCEREDRAWINDEX);
}
- r = add_pattern (&ColorIndexAuthorList, buf->data, 1, fg, bg, attr, err, 1);
+ else if (object == MT_COLOR_INDEX_AUTHOR)
+ {
- r = add_pattern (&ColorIndexFlagsList, buf->data, 1, fg, bg, attr, err, 1);
++ r = add_pattern (&ColorIndexAuthorList, buf->data, 1,
++ fg, bg, attr, err, 1, match);
+ set_option (OPTFORCEREDRAWINDEX);
+ }
+ else if (object == MT_COLOR_INDEX_FLAGS)
+ {
- r = add_pattern (&ColorIndexSubjectList, buf->data, 1, fg, bg, attr, err, 1);
++ r = add_pattern (&ColorIndexFlagsList, buf->data, 1,
++ fg, bg, attr, err, 1, match);
+ set_option (OPTFORCEREDRAWINDEX);
+ }
+ else if (object == MT_COLOR_INDEX_SUBJECT)
+ {
++ r = add_pattern (&ColorIndexSubjectList, buf->data, 1,
++ fg, bg, attr, err, 1, match);
+ set_option (OPTFORCEREDRAWINDEX);
+ }
else if (object == MT_COLOR_QUOTED)
{
if (q_level >= ColorQuoteSize)