You are not logged in.

#1 2011-02-08 18:35:00

Nimatek
Member
Registered: 2009-09-22
Posts: 25

urxvt ignores highlightColor in some applications since 9.09

As the subject says, since version 9.09 urxvt's highlighting behavior changed and its highlightColor setting is ignored in some applications, like vim or ncmpcpp, to name a few. Instead of using the specified color, background and foreground colors are simply inverted, which I find somewhat ugly and annoying.

I've asked on irc and no one else seemed to have this problem or was bothered by it. But on the chance that some else is experiencing this, here is a diff patch that restores the old behavior.

--- src/screen.C    2010-10-29 07:03:09.000000000 +0200
+++ src/screen.C    2011-02-06 20:38:00.992753433 +0100
@@ -2322,31 +2322,25 @@
                 fore = Color_UL;
 #endif
 
-#ifdef OPTION_HC
-              if (rend & RS_Sel)
-                {
-                  /* invert the column if no highlightColor is set or it is the
-                   * current cursor column */
-                  if (!(showcursor && row == screen.cur.row && text - stp == screen.cur.col)
-                      && ISSET_PIXCOLOR (Color_HC))
-                    {
-                      if (ISSET_PIXCOLOR (Color_HTC))
-                        fore = Color_HTC;
-                      // if invert is 0 reverse video is set so we use bg color as fg color
-                      else if (!invert)
-                        fore = back;
-
-                      back = Color_HC;
-                      invert = 0;
-                    }
-                }
-#endif
-
               if (invert)
                 {
+#ifdef OPTION_HC
+                  if ((showcursor && row == screen.cur.row && text - stp == screen.cur.col)
+                      || !ISSET_PIXCOLOR (Color_HC))
+#endif
+                    /* invert the column if no highlightColor is set or it is the
+                     * current cursor column */
                     ::swap (fore, back);
+#ifdef OPTION_HC
+                  else if (ISSET_PIXCOLOR (Color_HC))
+                    back = Color_HC;
+#endif
 
 #ifndef NO_BOLD_UNDERLINE_REVERSE
+# ifndef OPTION_HC
+                  if (ISSET_PIXCOLOR (Color_RV))
+                    back = Color_RV;
+# endif
                   if (fore == back)
                     {
                       fore = Color_bg;

Offline

Board footer

Powered by FluxBB