Changeset 545:e842decd824f for color.c

Show
Ignore:
Timestamp:
1998-11-09 03:15:28 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Fix an efficiency problem with the color index features.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • color.c

    r465 r545  
    429429  if (do_cache && !option (OPTNOCURSES)) 
    430430  { 
    431     mutt_cache_index_colors (Context); 
     431    int i; 
    432432    set_option (OPTFORCEREDRAWINDEX); 
     433    /* force re-caching of index colors */ 
     434    for (i = 0; Context && i < Context->msgcount; i++) 
     435      Context->hdrs[i]->pair = 0; 
    433436  } 
    434437  return (0); 
     
    505508    if (is_index)  
    506509    { 
     510      int i; 
     511 
    507512      strfcpy(buf, tmp->pattern, sizeof(buf)); 
    508513      mutt_check_simple (buf, sizeof (buf), NONULL(SimpleSearch)); 
     
    512517        return -1; 
    513518      } 
     519      /* force re-caching of index colors */ 
     520      for (i = 0; Context && i < Context->msgcount; i++) 
     521        Context->hdrs[i]->pair = 0; 
    514522    } 
    515523    tmp->pair = attr; 
     
    697705  { 
    698706    r = add_pattern (&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1); 
    699     mutt_cache_index_colors(Context); 
    700707    set_option (OPTFORCEREDRAWINDEX); 
    701708  }