if (do_cache && !option (OPTNOCURSES))
{
- mutt_cache_index_colors (Context);
+ int i;
set_option (OPTFORCEREDRAWINDEX);
+ /* force re-caching of index colors */
+ for (i = 0; Context && i < Context->msgcount; i++)
+ Context->hdrs[i]->pair = 0;
}
return (0);
}
#endif
if (is_index)
{
+ int i;
+
strfcpy(buf, tmp->pattern, sizeof(buf));
mutt_check_simple (buf, sizeof (buf), NONULL(SimpleSearch));
if((tmp->color_pattern = mutt_pattern_comp (buf, M_FULL_MSG, err)) == NULL)
mutt_free_color_line(&tmp, 1);
return -1;
}
+ /* force re-caching of index colors */
+ for (i = 0; Context && i < Context->msgcount; i++)
+ Context->hdrs[i]->pair = 0;
}
tmp->pair = attr;
*top = tmp;
else if (object == MT_COLOR_INDEX)
{
r = add_pattern (&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1);
- mutt_cache_index_colors(Context);
set_option (OPTFORCEREDRAWINDEX);
}
else if (object == MT_COLOR_QUOTED)
int index_color (int index_no)
{
- return Context->hdrs[Context->v2r[index_no]]->pair;
+ HEADER *h = Context->hdrs[Context->v2r[index_no]];
+
+ if (h->pair)
+ return h->pair;
+
+ mutt_set_header_color (Context, h);
+ return h->pair;
}
static int ci_next_undeleted (int msgno)
}
curhdr->pair = ColorDefs[MT_COLOR_NORMAL];
}
-
-void mutt_cache_index_colors (CONTEXT *ctx)
-{
- int i;
-
- if (ctx)
- for (i = 0; i < ctx->msgcount; i++)
- mutt_set_header_color (ctx, ctx->hdrs[i]);
-}
int mutt_write_mime_header (BODY *, FILE *);
int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int);
int mutt_yesorno (const char *, int);
-void mutt_cache_index_colors(CONTEXT *);
void mutt_set_header_color(CONTEXT *, HEADER *);
int mutt_save_confirm (const char *, struct stat *);
for (i = 0; i < ctx->msgcount; i++)
mutt_score_message (ctx->hdrs[i]);
- mutt_cache_index_colors (ctx);
+ /* force re-caching of index colors */
+ for (i = 0; ctx && i < ctx->msgcount; i++)
+ ctx->hdrs[i]->pair = 0;
unset_option (OPTNEEDRESCORE);
}
cur->collapsed = 0;
}
- mutt_cache_index_colors(ctx);
-
if (!ctx->quiet)
mutt_clear_error ();
}