--- browser.c.orig-mk Wed Dec 11 10:17:28 2002 +++ browser.c Sun Jan 19 23:14:33 2003 @@ -53,6 +53,8 @@ static char LastDir[_POSIX_PATH_MAX] = ""; static char LastDirBackup[_POSIX_PATH_MAX] = ""; +static int* FolderColors = NULL; + /* Frees up the memory allocated for the local-global variables. */ static void destroy_state (struct browser_state *state) { @@ -476,6 +478,33 @@ mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str, (unsigned long) &folder, M_FORMAT_ARROWCURSOR); } + +static void init_folder_colors(MUTTMENU *menu) +{ + int i; + unsigned numentries = menu->max; + + if (FolderColors) + FREE (&FolderColors); + + FolderColors = safe_calloc (numentries, sizeof (int)); + for (i=0; idata)[i].new) + FolderColors[i] = ColorDefs[MT_COLOR_BOLD]; + else + FolderColors[i] = ColorDefs[MT_COLOR_NORMAL]; + } +} + +static int folder_color (int index_no) +{ + if (!FolderColors) { + mutt_error _("Internal error. folder_color() called before init_folder_colors()!\n"); + return ColorDefs[MT_COLOR_NORMAL]; + } + + return FolderColors[index_no]; +} static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title, size_t titlelen, int buffy) @@ -509,6 +538,8 @@ path, NONULL(Mask.pattern)); } menu->redraw = REDRAW_FULL; + + init_folder_colors(menu); } int file_tag (MUTTMENU *menu, int n, int m) @@ -632,6 +663,7 @@ menu->search = select_file_search; menu->title = title; menu->data = state.entry; + menu->color = folder_color; if (multiple) menu->tag = file_tag;