* Matt Spong <[EMAIL PROTECTED]> [2001-10-20, 17:46 -0400]:
> Well, Ricardo... if that *is* your real name...
> 
> > I'd like to make it colorize all the way until the end of the line on which
> > the header terminates.
> > 
> > Is there a trick?
> 
> If there is, I haven't found it.  I've tried to get it to do that as
> well, and never managed to.  It seems to be a bug in mutt.

The way Mutt's pager draw a message is by first "clear" the line with
what is assumed to be that line's standard colour. A small typo makes
this fill the line with random characters though. But these are
instantly overwritten with the contents of the line in right colours.
Finally the line ending is cleared with a newline character. No colour
is specified here and thus at least ncurses and slang pick different
colours to fill the line with.

I reported this some time ago together with a patch (that messed things
up at other places;). If you dare to try I send along another patch that
might work better...

-- 
Ulf
--- pager-1.2.5i-orig.c Sat Apr 22 10:25:20 2000
+++ pager.c     Sun Oct 21 00:29:56 2001
@@ -1221,21 +1221,9 @@
 
   if (flags & M_SHOWCOLOR)
   {
-    m = ((*lineInfo)[n].continuation) ? ((*lineInfo)[n].syntax)[0].first : n;
-    if ((*lineInfo)[m].type == MT_COLOR_HEADER)
-      def_color = ((*lineInfo)[m].syntax)[0].color;
-    else
-      def_color = (*lineInfo)[m].type;
-
-    attrset (def_color);
-#ifdef HAVE_BKGDSET
-    bkgdset (def_color | ' ');
-#endif
-    clrtoeol ();
     SETCOLOR (MT_COLOR_NORMAL);
     BKGDSET (MT_COLOR_NORMAL);
   }
-  else
     clrtoeol ();
   
   /* display the line */
@@ -1359,7 +1347,33 @@
 #ifndef USE_SLANG_CURSES
     if (col < COLS)
 #endif
+  {
+    if (flags & M_SHOWCOLOR)
+    {
+      m = ((*lineInfo)[n].continuation) ? ((*lineInfo)[n].syntax)[0].first : n;
+      if ((*lineInfo)[m].type == MT_COLOR_HEADER)
+       def_color = ((*lineInfo)[m].syntax)[0].color;
+      else
+       def_color = ColorDefs[(*lineInfo)[m].type];
+
+      if (def_color) {
+       attrset (def_color);
+#ifdef HAVE_BKGDSET
+       bkgdset (def_color | ' ');
+#endif
+      }
+      else 
+      {
+       SETCOLOR (MT_COLOR_NORMAL);
+       BKGDSET (MT_COLOR_NORMAL);
+      }
       addch ('\n');
+      SETCOLOR (MT_COLOR_NORMAL);
+      BKGDSET (MT_COLOR_NORMAL);
+    }
+    else
+      addch ('\n');
+  }
 
   /* build a return code */
   if (!(flags & M_SHOW))

Reply via email to