Hi.

There is patch to fix that problem.

That bug is caused by the fact, that ncurses colorpairs should be
in range 1..COLOR_PAIRS-1, and black on black in weechat's terms
is color pair 0. I put black on black to pair 64.

Also I removed restriction for white on white - IMHO, user should
have as much options, as he can, and, probably, can detect such
simple configuration errors by himself.

Thus, I added two new color definitions: lightblack and gray
(aka non-light white), though, they, more likely, should be named
gray and darkwhite appropriately.

-- 
Михайло Даниленко
-------------------------------
jabber: <[email protected]>
icq:    200352743
--- a/src/gui/curses/gui-curses-color.c	2009-03-14 23:42:49.000000000 +0200
+++ b/src/gui/curses/gui-curses-color.c	2009-05-22 16:41:50.000000000 +0300
@@ -38,6 +38,7 @@
 t_gui_color gui_weechat_colors[] =
 { { -1,                    0, 0,        "default"      },
   { WEECHAT_COLOR_BLACK,   0, 0,        "black"        },
+  { WEECHAT_COLOR_BLACK,   0, A_BOLD,   "lightblack"   },
   { WEECHAT_COLOR_RED,     0, 0,        "red"          },
   { WEECHAT_COLOR_RED,     0, A_BOLD,   "lightred"     },
   { WEECHAT_COLOR_GREEN,   0, 0,        "green"        },
@@ -50,6 +51,7 @@
   { WEECHAT_COLOR_MAGENTA, 0, A_BOLD,   "lightmagenta" },
   { WEECHAT_COLOR_CYAN,    0, 0,        "cyan"         },
   { WEECHAT_COLOR_CYAN,    0, A_BOLD,   "lightcyan"    },
+  { WEECHAT_COLOR_WHITE,   0, 0,        "gray"         },
   { WEECHAT_COLOR_WHITE,   0, A_BOLD,   "white"        },
   { 0,                     0, 0,        NULL           }
 };
@@ -456,7 +458,7 @@
 int
 gui_color_get_pair (int num_color)
 {
-    int fg, bg;
+    int fg, bg, pair;
     
     if ((num_color < 0) || (num_color > GUI_NUM_COLORS - 1))
         return WEECHAT_COLOR_WHITE;
@@ -472,7 +474,11 @@
     if ((bg == -1) || (bg == 99))
         bg = 0;
     
-    return (bg * 8) + fg;
+    pair = (bg * 8) + fg;
+    if (pair == 0)
+        pair = 64;
+    
+    return pair;
 }
 
 /*
@@ -490,8 +496,8 @@
         for (i = 1; i < 64; i++)
             init_pair (i, shift_colors[i % 8], (i < 8) ? -1 : shift_colors[i / 8]);
         
-        /* disable white on white, replaced by black on white */
-        init_pair (63, -1, -1);
+        /* use pair 64 as black on black */
+        init_pair (64, 0, 0);
         
         /* white on default bg is default (-1) */
         if (!cfg_col_real_white)

Reply via email to