If there is a special color defined for the spool folder in the sidebar, the
current behavior is to always use this color to highlight the spool folder in 
the
sidebar. Accordingly, the folder is not highlighted with the color for new mails
if it contains new mails or flagged mails if it contains flagged mails.

Now it is possible to define whether the spool folder should always be 
highlighted
as spool folder, or if it should also use the highlights for folders with new or
flagged mails. The default is to use the old behavior.

Signed-off-by: Till Smejkal <till.smej...@ossmail.de>

diff --git a/init.h b/init.h
--- a/init.h
+++ b/init.h
@@ -2849,6 +2849,13 @@
   ** For example: sidebar_width=20 could display 20 ASCII characters, or 10
   ** Chinese characters.
   */
+  { "sidebar_always_highlight_spool", DT_BOOL, R_SIDEBAR, 
OPTSIDEBARALWAYSHIGHLIGHTSPOOL, 1 },
+  /*
+  ** .pp
+  ** This controls whether the spool folder should always be highlighted with 
its
+  ** special spool folder color (default) or if highlights for new or flagged 
mails
+  ** are allowed to override it.
+  */
 #endif
   { "sig_dashes",      DT_BOOL, R_NONE, OPTSIGDASHES, 1 },
   /*
diff --git a/mutt.h b/mutt.h
--- a/mutt.h
+++ b/mutt.h
@@ -448,6 +448,7 @@
   OPTSIDEBARNEWMAILONLY,
   OPTSIDEBARNEXTNEWWRAP,
   OPTSIDEBARSHORTPATH,
+  OPTSIDEBARALWAYSHIGHLIGHTSPOOL,
 #endif
   OPTSIGDASHES,
   OPTSIGONTOP,
diff --git a/sidebar.c b/sidebar.c
--- a/sidebar.c
+++ b/sidebar.c
@@ -567,13 +567,18 @@
     }
     else if (entryidx == HilIndex)
       SETCOLOR(MT_COLOR_HIGHLIGHT);
-    else if ((ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) &&
-               (mutt_strcmp (b->path, Spoolfile) == 0))
+    else if (option(OPTSIDEBARALWAYSHIGHLIGHTSPOOL) &&
+             (ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) &&
+             (mutt_strcmp (b->path, Spoolfile) == 0))
       SETCOLOR(MT_COLOR_SB_SPOOLFILE);
     else if ((b->msg_unread > 0) || (b->new))
       SETCOLOR(MT_COLOR_NEW);
     else if (b->msg_flagged > 0)
       SETCOLOR(MT_COLOR_FLAGGED);
+    else if (!option(OPTSIDEBARALWAYSHIGHLIGHTSPOOL) &&
+             (ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) &&
+             (mutt_strcmp (b->path, Spoolfile) == 0))
+      SETCOLOR(MT_COLOR_SB_SPOOLFILE);
     else
       SETCOLOR(MT_COLOR_NORMAL);
 


Reply via email to