]> granicus.if.org Git - neomutt/commitdiff
fix: broken index_format
authorRichard Russon <rich@flatcap.org>
Mon, 7 Oct 2019 12:07:26 +0000 (13:07 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 7 Oct 2019 12:07:26 +0000 (13:07 +0100)
A chance alignment made enum symbol MT_COLOR_INDEX_NUMBER equal to 37
(ASCII %).  This was causing problems when inserting colour codes into
the index_format string.

color.h

diff --git a/color.h b/color.h
index 7a30322ad3ab215bfed1488628a4d13dac71ffb4..f847132a7b244d5ae1a791b91612b214deea6d00 100644 (file)
--- a/color.h
+++ b/color.h
@@ -51,10 +51,14 @@ STAILQ_HEAD(ColorLineList, ColorLine);
 
 /**
  * enum ColorId - List of all colored objects
+ *
+ * This enumeration starts at 50 to avoid any of the values being 37 (ASCII %).
+ * Inserting colour codes into expando strings, when one of the colour codes
+ * was '%', was causing formatting problems.
  */
 enum ColorId
 {
-  MT_COLOR_HDEFAULT = 0,             ///< Header default colour
+  MT_COLOR_HDEFAULT = 50,            ///< Header default colour
   MT_COLOR_QUOTED,                   ///< Pager: quoted text
   MT_COLOR_SIGNATURE,                ///< Pager: signature lines
   MT_COLOR_INDICATOR,                ///< Selected item in list