home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.049 < prev    next >
Encoding:
Internet Message Format  |  2002-11-04  |  36.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.049 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.049 (extra)
  11. Problem:    On a 32 bit display a valid color may cause an error message,
  12.         because its pixel value is negative. (Chris Paulson-Ellis)
  13. Solution:   Check for -11111 instead of the color being negative.
  14.         Don't add one to the pixel value, -1 may be used for white.
  15. Files:        src/globals.h, src/gui.c, src/gui.h, src/gui_amiga.c,
  16.         src/gui_athena.c, src/gui_beos.cc, src/gui_gtk_x11.c,
  17.         src/gui_mac.c, src/gui_motif.c, src/gui_photon.c,
  18.         src/gui_riscos.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c,
  19.         src/gui_x11.c, src/mbyte.c, src/syntax.c
  20.  
  21.  
  22. *** ../vim61.048/src/globals.h    Mon Apr 29 21:59:52 2002
  23. --- src/globals.h    Thu May  2 22:04:09 2002
  24. ***************
  25. *** 620,627 ****
  26.   # else
  27.   EXTERN XIC        xic INIT(= NULL);
  28.   # endif
  29. ! EXTERN guicolor_T    xim_fg_color INIT(= (guicolor_T)-1);
  30. ! EXTERN guicolor_T    xim_bg_color INIT(= (guicolor_T)-1);
  31.   #endif
  32.   
  33.   #ifdef FEAT_HANGULIN
  34. --- 620,627 ----
  35.   # else
  36.   EXTERN XIC        xic INIT(= NULL);
  37.   # endif
  38. ! EXTERN guicolor_T    xim_fg_color INIT(= INVALCOLOR);
  39. ! EXTERN guicolor_T    xim_bg_color INIT(= INVALCOLOR);
  40.   #endif
  41.   
  42.   #ifdef FEAT_HANGULIN
  43. *** ../vim61.048/src/gui.c    Wed May  1 21:20:47 2002
  44. --- src/gui.c    Thu May  2 21:54:33 2002
  45. ***************
  46. *** 830,837 ****
  47.           id = shape_table[idx].id;
  48.   
  49.       /* get the colors and attributes for the cursor.  Default is inverted */
  50. !     cfg = (guicolor_T)-1;
  51. !     cbg = (guicolor_T)-1;
  52.       cattr = HL_INVERSE;
  53.       gui_mch_set_blinking(shape_table[idx].blinkwait,
  54.                    shape_table[idx].blinkon,
  55. --- 830,837 ----
  56.           id = shape_table[idx].id;
  57.   
  58.       /* get the colors and attributes for the cursor.  Default is inverted */
  59. !     cfg = INVALCOLOR;
  60. !     cbg = INVALCOLOR;
  61.       cattr = HL_INVERSE;
  62.       gui_mch_set_blinking(shape_table[idx].blinkwait,
  63.                    shape_table[idx].blinkon,
  64. ***************
  65. *** 850,863 ****
  66.               if (iid > 0)
  67.               {
  68.               syn_id2colors(iid, &fg, &bg);
  69. !             if (bg > 0)
  70.                   cbg = bg;
  71.               }
  72.           }
  73.           }
  74.   #endif
  75. -         --cbg;
  76. -         --cfg;
  77.       }
  78.   
  79.       /*
  80. --- 850,861 ----
  81.               if (iid > 0)
  82.               {
  83.               syn_id2colors(iid, &fg, &bg);
  84. !             if (bg != INVALCOLOR)
  85.                   cbg = bg;
  86.               }
  87.           }
  88.           }
  89.   #endif
  90.       }
  91.   
  92.       /*
  93. ***************
  94. *** 870,898 ****
  95.       if (aep != NULL)
  96.       {
  97.           attr = aep->ae_attr;
  98. !         if (cfg < 0)
  99.           cfg = ((attr & HL_INVERSE)  ? aep->ae_u.gui.bg_color
  100. !                         : aep->ae_u.gui.fg_color) - 1;
  101. !         if (cbg < 0)
  102.           cbg = ((attr & HL_INVERSE)  ? aep->ae_u.gui.fg_color
  103. !                         : aep->ae_u.gui.bg_color) - 1;
  104.       }
  105. !     if (cfg < 0)
  106.           cfg = (attr & HL_INVERSE) ? gui.back_pixel : gui.norm_pixel;
  107. !     if (cbg < 0)
  108.           cbg = (attr & HL_INVERSE) ? gui.norm_pixel : gui.back_pixel;
  109.   
  110.   #ifdef FEAT_XIM
  111.       if (aep != NULL)
  112.       {
  113.           xim_bg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.fg_color
  114. !                         : aep->ae_u.gui.bg_color) - 1;
  115.           xim_fg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.bg_color
  116. !                         : aep->ae_u.gui.fg_color) - 1;
  117. !         if (xim_bg_color < 0)
  118.           xim_bg_color = (attr & HL_INVERSE) ? gui.norm_pixel
  119.                              : gui.back_pixel;
  120. !         if (xim_fg_color < 0)
  121.           xim_fg_color = (attr & HL_INVERSE) ? gui.back_pixel
  122.                              : gui.norm_pixel;
  123.       }
  124. --- 868,896 ----
  125.       if (aep != NULL)
  126.       {
  127.           attr = aep->ae_attr;
  128. !         if (cfg == INVALCOLOR)
  129.           cfg = ((attr & HL_INVERSE)  ? aep->ae_u.gui.bg_color
  130. !                         : aep->ae_u.gui.fg_color);
  131. !         if (cbg == INVALCOLOR)
  132.           cbg = ((attr & HL_INVERSE)  ? aep->ae_u.gui.fg_color
  133. !                         : aep->ae_u.gui.bg_color);
  134.       }
  135. !     if (cfg == INVALCOLOR)
  136.           cfg = (attr & HL_INVERSE) ? gui.back_pixel : gui.norm_pixel;
  137. !     if (cbg == INVALCOLOR)
  138.           cbg = (attr & HL_INVERSE) ? gui.norm_pixel : gui.back_pixel;
  139.   
  140.   #ifdef FEAT_XIM
  141.       if (aep != NULL)
  142.       {
  143.           xim_bg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.fg_color
  144. !                         : aep->ae_u.gui.bg_color);
  145.           xim_fg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.bg_color
  146. !                         : aep->ae_u.gui.fg_color);
  147. !         if (xim_bg_color == INVALCOLOR)
  148.           xim_bg_color = (attr & HL_INVERSE) ? gui.norm_pixel
  149.                              : gui.back_pixel;
  150. !         if (xim_fg_color == INVALCOLOR)
  151.           xim_fg_color = (attr & HL_INVERSE) ? gui.back_pixel
  152.                              : gui.norm_pixel;
  153.       }
  154. ***************
  155. *** 1839,1853 ****
  156.       else if (aep != NULL)
  157.       {
  158.       fg_color = aep->ae_u.gui.fg_color;
  159. !     if (fg_color == 0)
  160.           fg_color = gui.norm_pixel;
  161. -     else
  162. -         --fg_color;
  163.       bg_color = aep->ae_u.gui.bg_color;
  164. !     if (bg_color == 0)
  165.           bg_color = gui.back_pixel;
  166. -     else
  167. -         --bg_color;
  168.       }
  169.       else
  170.       fg_color = gui.norm_pixel;
  171. --- 1837,1847 ----
  172.       else if (aep != NULL)
  173.       {
  174.       fg_color = aep->ae_u.gui.fg_color;
  175. !     if (fg_color == INVALCOLOR)
  176.           fg_color = gui.norm_pixel;
  177.       bg_color = aep->ae_u.gui.bg_color;
  178. !     if (bg_color == INVALCOLOR)
  179.           bg_color = gui.back_pixel;
  180.       }
  181.       else
  182.       fg_color = gui.norm_pixel;
  183. ***************
  184. *** 3659,3668 ****
  185.       void
  186.   gui_check_colors()
  187.   {
  188. !     if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == (guicolor_T)-1)
  189.       {
  190.       gui_set_bg_color((char_u *)"White");
  191. !     if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == (guicolor_T)-1)
  192.           gui_set_fg_color((char_u *)"Black");
  193.       }
  194.   }
  195. --- 3653,3662 ----
  196.       void
  197.   gui_check_colors()
  198.   {
  199. !     if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
  200.       {
  201.       gui_set_bg_color((char_u *)"White");
  202. !     if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
  203.           gui_set_fg_color((char_u *)"Black");
  204.       }
  205.   }
  206. ***************
  207. *** 3685,3691 ****
  208.   
  209.   /*
  210.    * Allocate a color by name.
  211. !  * Returns -1 and gives an error message when failed.
  212.    */
  213.       guicolor_T
  214.   gui_get_color(name)
  215. --- 3679,3685 ----
  216.   
  217.   /*
  218.    * Allocate a color by name.
  219. !  * Returns INVALCOLOR and gives an error message when failed.
  220.    */
  221.       guicolor_T
  222.   gui_get_color(name)
  223. ***************
  224. *** 3694,3702 ****
  225.       guicolor_T    t;
  226.   
  227.       if (*name == NUL)
  228. !     return (guicolor_T)-1;
  229.       t = gui_mch_get_color(name);
  230. !     if (t < 0
  231.   #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
  232.           && gui.in_use
  233.   #endif
  234. --- 3688,3696 ----
  235.       guicolor_T    t;
  236.   
  237.       if (*name == NUL)
  238. !     return INVALCOLOR;
  239.       t = gui_mch_get_color(name);
  240. !     if (t == INVALCOLOR
  241.   #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
  242.           && gui.in_use
  243.   #endif
  244. *** ../vim61.048/src/gui.h    Wed May  1 21:20:47 2002
  245. --- src/gui.h    Thu May  2 21:01:33 2002
  246. ***************
  247. *** 224,229 ****
  248. --- 224,232 ----
  249.   typedef long        guicolor_T;    /* handle for a GUI color; for X11 this should
  250.                      be "Pixel", but that's an unsigned and we
  251.                      need a signed value */
  252. + #define INVALCOLOR (guicolor_T)-11111    /* number for invalid color; on 32 bit
  253. +                    displays there is a tiny chance this is an
  254. +                    actual color */
  255.   
  256.   #ifdef FEAT_GUI_GTK
  257.     typedef GdkFont    *GuiFont;    /* handle for a GUI font */
  258. *** ../vim61.048/src/gui_amiga.c    Thu Feb 21 21:04:21 2002
  259. --- src/gui_amiga.c    Thu May  2 21:56:12 2002
  260. ***************
  261. *** 943,948 ****
  262. --- 943,952 ----
  263.   
  264.   #define RGB(a, b, c) ((a && 0xff) * 0x10000 + (b * 0xff) * 0x100 + (c & 0xff))
  265.   
  266. + /*
  267. +  * Get color handle for color "name".
  268. +  * Return INVALCOLOR when not possible.
  269. +  */
  270.       guicolor_T
  271.   gui_mch_get_color(char_u *name)
  272.   {
  273. ***************
  274. *** 991,997 ****
  275.       {NULL, NULL},
  276.       };
  277.   
  278. !     guicolor_T color = (guicolor_T)-1;
  279.   
  280.       int i;
  281.   
  282. --- 995,1001 ----
  283.       {NULL, NULL},
  284.       };
  285.   
  286. !     guicolor_T color = INVALCOLOR;
  287.   
  288.       int i;
  289.   
  290. ***************
  291. *** 1001,1013 ****
  292.           color = table[i].color;
  293.       }
  294.   
  295. !     if (color == -1)
  296.       {
  297.       char *looky = NULL;
  298.   
  299.       color = strtol((char*)name, &looky, 10);
  300.       if (*looky != NUL)
  301. !         color = -1;
  302.       }
  303.   
  304.       return color;
  305. --- 1005,1017 ----
  306.           color = table[i].color;
  307.       }
  308.   
  309. !     if (color == INVALCOLOR)
  310.       {
  311.       char *looky = NULL;
  312.   
  313.       color = strtol((char*)name, &looky, 10);
  314.       if (*looky != NUL)
  315. !         color = INVALCOLOR;
  316.       }
  317.   
  318.       return color;
  319. *** ../vim61.048/src/gui_athena.c    Thu Mar 21 22:36:36 2002
  320. --- src/gui_athena.c    Thu May  2 21:44:14 2002
  321. ***************
  322. *** 218,224 ****
  323.       XtNinsertPosition,    athena_calculate_ins_pos,
  324.       NULL);
  325.       gui_athena_menu_colors(menuBar);
  326. !     if (gui.menu_fg_pixel != -1)
  327.       XtVaSetValues(menuBar, XtNborderColor, gui.menu_fg_pixel, NULL);
  328.   #endif
  329.   
  330. --- 218,224 ----
  331.       XtNinsertPosition,    athena_calculate_ins_pos,
  332.       NULL);
  333.       gui_athena_menu_colors(menuBar);
  334. !     if (gui.menu_fg_pixel != INVALCOLOR)
  335.       XtVaSetValues(menuBar, XtNborderColor, gui.menu_fg_pixel, NULL);
  336.   #endif
  337.   
  338. ***************
  339. *** 1284,1290 ****
  340.   {
  341.       if (menuBar == (Widget)0)
  342.       return;
  343. !     if (gui.menu_fg_pixel != -1)
  344.       XtVaSetValues(menuBar, XtNborderColor,    gui.menu_fg_pixel, NULL);
  345.       gui_athena_menu_colors(menuBar);
  346.   #ifdef FEAT_TOOLBAR
  347. --- 1284,1290 ----
  348.   {
  349.       if (menuBar == (Widget)0)
  350.       return;
  351. !     if (gui.menu_fg_pixel != INVALCOLOR)
  352.       XtVaSetValues(menuBar, XtNborderColor,    gui.menu_fg_pixel, NULL);
  353.       gui_athena_menu_colors(menuBar);
  354.   #ifdef FEAT_TOOLBAR
  355. ***************
  356. *** 2118,2126 ****
  357.   gui_athena_menu_colors(id)
  358.       Widget  id;
  359.   {
  360. !     if (gui.menu_bg_pixel != -1)
  361.       XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL);
  362. !     if (gui.menu_fg_pixel != -1)
  363.       XtVaSetValues(id, XtNforeground, gui.menu_fg_pixel, NULL);
  364.   }
  365.   #endif
  366. --- 2118,2126 ----
  367.   gui_athena_menu_colors(id)
  368.       Widget  id;
  369.   {
  370. !     if (gui.menu_bg_pixel != INVALCOLOR)
  371.       XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL);
  372. !     if (gui.menu_fg_pixel != INVALCOLOR)
  373.       XtVaSetValues(id, XtNforeground, gui.menu_fg_pixel, NULL);
  374.   }
  375.   #endif
  376. ***************
  377. *** 2132,2139 ****
  378.   gui_athena_scroll_colors(id)
  379.       Widget  id;
  380.   {
  381. !     if (gui.scroll_bg_pixel != -1)
  382.       XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL);
  383. !     if (gui.scroll_fg_pixel != -1)
  384.       XtVaSetValues(id, XtNforeground, gui.scroll_fg_pixel, NULL);
  385.   }
  386. --- 2132,2139 ----
  387.   gui_athena_scroll_colors(id)
  388.       Widget  id;
  389.   {
  390. !     if (gui.scroll_bg_pixel != INVALCOLOR)
  391.       XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL);
  392. !     if (gui.scroll_fg_pixel != INVALCOLOR)
  393.       XtVaSetValues(id, XtNforeground, gui.scroll_fg_pixel, NULL);
  394.   }
  395. *** ../vim61.048/src/gui_beos.cc    Sun Feb 17 17:16:41 2002
  396. --- src/gui_beos.cc    Thu May  2 22:02:37 2002
  397. ***************
  398. *** 2465,2471 ****
  399.    * This function has been lifted from gui_w32.c and extended a bit.
  400.    *
  401.    * Return the Pixel value (color) for the given color name.
  402. !  * Return -1 for error.
  403.    */
  404.       guicolor_T
  405.   gui_mch_get_color(
  406. --- 2465,2471 ----
  407.    * This function has been lifted from gui_w32.c and extended a bit.
  408.    *
  409.    * Return the Pixel value (color) for the given color name.
  410. !  * Return INVALCOLOR for error.
  411.    */
  412.       guicolor_T
  413.   gui_mch_get_color(
  414. ***************
  415. *** 2530,2536 ****
  416.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  417.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  418.       if (r < 0 || g < 0 || b < 0)
  419. !         return (guicolor_T)-1;
  420.       return RGB(r, g, b);
  421.       }
  422.       else
  423. --- 2530,2536 ----
  424.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  425.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  426.       if (r < 0 || g < 0 || b < 0)
  427. !         return INVALCOLOR;
  428.       return RGB(r, g, b);
  429.       }
  430.       else
  431. ***************
  432. *** 2552,2563 ****
  433.   
  434.       fname = expand_env_save((char_u *)"$VIM/rgb.txt");
  435.       if (fname == NULL)
  436. !         return (guicolor_T)-1;
  437.   
  438.       fd = fopen((char *)fname, "rt");
  439.       vim_free(fname);
  440.       if (fd == NULL)
  441. !         return (guicolor_T)-1;
  442.   
  443.       while (!feof(fd))
  444.       {
  445. --- 2552,2563 ----
  446.   
  447.       fname = expand_env_save((char_u *)"$VIM/rgb.txt");
  448.       if (fname == NULL)
  449. !         return INVALCOLOR;
  450.   
  451.       fd = fopen((char *)fname, "rt");
  452.       vim_free(fname);
  453.       if (fd == NULL)
  454. !         return INVALCOLOR;
  455.   
  456.       while (!feof(fd))
  457.       {
  458. ***************
  459. *** 2606,2612 ****
  460.       fclose(fd);
  461.       }
  462.   
  463. !     return (guicolor_T)-1;
  464.   }
  465.   
  466.   /*
  467. --- 2606,2612 ----
  468.       fclose(fd);
  469.       }
  470.   
  471. !     return INVALCOLOR;
  472.   }
  473.   
  474.   /*
  475. *** ../vim61.048/src/gui_gtk_x11.c    Fri May  3 22:02:55 2002
  476. --- src/gui_gtk_x11.c    Fri May  3 20:43:39 2002
  477. ***************
  478. *** 2830,2836 ****
  479.    * Return the Pixel value (color) for the given color name.  This routine was
  480.    * pretty much taken from example code in the Silicon Graphics OSF/Motif
  481.    * Programmer's Guide.
  482. !  * Return -1 for error.
  483.    */
  484.       guicolor_T
  485.   gui_mch_get_color(char_u * name)
  486. --- 2830,2836 ----
  487.    * Return the Pixel value (color) for the given color name.  This routine was
  488.    * pretty much taken from example code in the Silicon Graphics OSF/Motif
  489.    * Programmer's Guide.
  490. !  * Return INVALCOLOR for error.
  491.    */
  492.       guicolor_T
  493.   gui_mch_get_color(char_u * name)
  494. ***************
  495. *** 2852,2858 ****
  496.       };
  497.   
  498.       if (!gui.in_use)        /* can't do this when GUI not running */
  499. !     return (guicolor_T)(-1);
  500.   
  501.       while (name != NULL)
  502.       {
  503. --- 2852,2858 ----
  504.       };
  505.   
  506.       if (!gui.in_use)        /* can't do this when GUI not running */
  507. !     return INVALCOLOR;
  508.   
  509.       while (name != NULL)
  510.       {
  511. ***************
  512. *** 2913,2919 ****
  513.       }
  514.       }
  515.   
  516. !     return (guicolor_T)(-1);
  517.   }
  518.   
  519.   /*
  520. --- 2913,2919 ----
  521.       }
  522.       }
  523.   
  524. !     return INVALCOLOR;
  525.   }
  526.   
  527.   /*
  528. *** ../vim61.048/src/gui_mac.c    Thu Mar 21 20:39:48 2002
  529. --- src/gui_mac.c    Thu May  2 21:58:41 2002
  530. ***************
  531. *** 3046,3051 ****
  532. --- 3046,3052 ----
  533.    * Return the Pixel value (color) for the given color name.  This routine was
  534.    * pretty much taken from example code in the Silicon Graphics OSF/Motif
  535.    * Programmer's Guide.
  536. +  * Return INVALCOLOR when failed.
  537.    */
  538.       guicolor_T
  539.   gui_mch_get_color(name)
  540. ***************
  541. *** 3111,3117 ****
  542.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  543.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  544.       if (r < 0 || g < 0 || b < 0)
  545. !         return (guicolor_T) -1;
  546.       return RGB(r, g, b);
  547.       }
  548.       else
  549. --- 3112,3118 ----
  550.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  551.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  552.       if (r < 0 || g < 0 || b < 0)
  553. !         return INVALCOLOR;
  554.       return RGB(r, g, b);
  555.       }
  556.       else
  557. ***************
  558. *** 3143,3154 ****
  559.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  560.   #endif
  561.       if (fname == NULL)
  562. !         return (guicolor_T)-1;
  563.   
  564.       fd = fopen((char *)fname, "rt");
  565.       vim_free(fname);
  566.       if (fd == NULL)
  567. !         return (guicolor_T)-1;
  568.   
  569.       while (!feof(fd))
  570.       {
  571. --- 3144,3155 ----
  572.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  573.   #endif
  574.       if (fname == NULL)
  575. !         return INVALCOLOR;
  576.   
  577.       fd = fopen((char *)fname, "rt");
  578.       vim_free(fname);
  579.       if (fd == NULL)
  580. !         return INVALCOLOR;
  581.   
  582.       while (!feof(fd))
  583.       {
  584. ***************
  585. *** 3179,3185 ****
  586.       fclose(fd);
  587.       }
  588.   
  589. !     return -1;
  590.   }
  591.   
  592.   /*
  593. --- 3180,3186 ----
  594.       fclose(fd);
  595.       }
  596.   
  597. !     return INVALCOLOR;
  598.   }
  599.   
  600.   /*
  601. *** ../vim61.048/src/gui_motif.c    Wed May  1 21:20:47 2002
  602. --- src/gui_motif.c    Thu May  2 21:48:29 2002
  603. ***************
  604. *** 547,557 ****
  605.       if (mouse_model_popup())
  606.   # endif
  607.       {
  608. !         if (gui.menu_bg_pixel != -1)
  609.           {
  610.           XtSetArg(arg[0], XmNbackground, gui.menu_bg_pixel); n++;
  611.           }
  612. !         if (gui.menu_fg_pixel != -1)
  613.           {
  614.           XtSetArg(arg[1], XmNforeground, gui.menu_fg_pixel); n++;
  615.           }
  616. --- 547,557 ----
  617.       if (mouse_model_popup())
  618.   # endif
  619.       {
  620. !         if (gui.menu_bg_pixel != INVALCOLOR)
  621.           {
  622.           XtSetArg(arg[0], XmNbackground, gui.menu_bg_pixel); n++;
  623.           }
  624. !         if (gui.menu_fg_pixel != INVALCOLOR)
  625.           {
  626.           XtSetArg(arg[1], XmNforeground, gui.menu_fg_pixel); n++;
  627.           }
  628. ***************
  629. *** 1445,1451 ****
  630.   {
  631.       if (sb->id != (Widget)0)
  632.       {
  633. !     if (gui.scroll_bg_pixel != (guicolor_T)-1)
  634.       {
  635.   #if (XmVersion>=1002)
  636.           XmChangeColor(sb->id, gui.scroll_bg_pixel);
  637. --- 1445,1451 ----
  638.   {
  639.       if (sb->id != (Widget)0)
  640.       {
  641. !     if (gui.scroll_bg_pixel != INVALCOLOR)
  642.       {
  643.   #if (XmVersion>=1002)
  644.           XmChangeColor(sb->id, gui.scroll_bg_pixel);
  645. ***************
  646. *** 1456,1462 ****
  647.   #endif
  648.       }
  649.   
  650. !     if (gui.scroll_fg_pixel != (guicolor_T)-1)
  651.           XtVaSetValues(sb->id,
  652.               XmNforeground, gui.scroll_fg_pixel,
  653.   #if (XmVersion<1002)
  654. --- 1456,1462 ----
  655.   #endif
  656.       }
  657.   
  658. !     if (gui.scroll_fg_pixel != INVALCOLOR)
  659.           XtVaSetValues(sb->id,
  660.               XmNforeground, gui.scroll_fg_pixel,
  661.   #if (XmVersion<1002)
  662. ***************
  663. *** 1620,1626 ****
  664.       set_predefined_label(dialog_wgt, "Selection", _("Selection"));
  665.   
  666.       gui_motif_menu_colors(dialog_wgt);
  667. !     if (gui.scroll_bg_pixel != -1)
  668.       XtVaSetValues(dialog_wgt, XmNtroughColor, gui.scroll_bg_pixel, NULL);
  669.   
  670.       XtAddCallback(dialog_wgt, XmNokCallback, DialogAcceptCB, (XtPointer)0);
  671. --- 1620,1626 ----
  672.       set_predefined_label(dialog_wgt, "Selection", _("Selection"));
  673.   
  674.       gui_motif_menu_colors(dialog_wgt);
  675. !     if (gui.scroll_bg_pixel != INVALCOLOR)
  676.       XtVaSetValues(dialog_wgt, XmNtroughColor, gui.scroll_bg_pixel, NULL);
  677.   
  678.       XtAddCallback(dialog_wgt, XmNokCallback, DialogAcceptCB, (XtPointer)0);
  679. ***************
  680. *** 2490,2502 ****
  681.   gui_motif_menu_colors(id)
  682.       Widget  id;
  683.   {
  684. !     if (gui.menu_bg_pixel != (guicolor_T)-1)
  685.   #if (XmVersion >= 1002)
  686.       XmChangeColor(id, gui.menu_bg_pixel);
  687.   #else
  688.       XtVaSetValues(id, XmNbackground, gui.menu_bg_pixel, NULL);
  689.   #endif
  690. !     if (gui.menu_fg_pixel != (guicolor_T)-1)
  691.       XtVaSetValues(id, XmNforeground, gui.menu_fg_pixel, NULL);
  692.   }
  693.   
  694. --- 2490,2502 ----
  695.   gui_motif_menu_colors(id)
  696.       Widget  id;
  697.   {
  698. !     if (gui.menu_bg_pixel != INVALCOLOR)
  699.   #if (XmVersion >= 1002)
  700.       XmChangeColor(id, gui.menu_bg_pixel);
  701.   #else
  702.       XtVaSetValues(id, XmNbackground, gui.menu_bg_pixel, NULL);
  703.   #endif
  704. !     if (gui.menu_fg_pixel != INVALCOLOR)
  705.       XtVaSetValues(id, XmNforeground, gui.menu_fg_pixel, NULL);
  706.   }
  707.   
  708. ***************
  709. *** 2507,2519 ****
  710.   gui_motif_scroll_colors(id)
  711.       Widget  id;
  712.   {
  713. !     if (gui.scroll_bg_pixel != (guicolor_T)-1)
  714.   #if (XmVersion >= 1002)
  715.       XmChangeColor(id, gui.scroll_bg_pixel);
  716.   #else
  717.       XtVaSetValues(id, XmNbackground, gui.scroll_bg_pixel, NULL);
  718.   #endif
  719. !     if (gui.scroll_fg_pixel != (guicolor_T)-1)
  720.       XtVaSetValues(id, XmNforeground, gui.scroll_fg_pixel, NULL);
  721.   }
  722.   
  723. --- 2507,2519 ----
  724.   gui_motif_scroll_colors(id)
  725.       Widget  id;
  726.   {
  727. !     if (gui.scroll_bg_pixel != INVALCOLOR)
  728.   #if (XmVersion >= 1002)
  729.       XmChangeColor(id, gui.scroll_bg_pixel);
  730.   #else
  731.       XtVaSetValues(id, XmNbackground, gui.scroll_bg_pixel, NULL);
  732.   #endif
  733. !     if (gui.scroll_fg_pixel != INVALCOLOR)
  734.       XtVaSetValues(id, XmNforeground, gui.scroll_fg_pixel, NULL);
  735.   }
  736.   
  737. *** ../vim61.048/src/gui_photon.c    Sun Feb 24 19:35:58 2002
  738. --- src/gui_photon.c    Thu May  2 21:59:59 2002
  739. ***************
  740. *** 1992,1997 ****
  741. --- 1992,1998 ----
  742.    * every port does basically the same thing.
  743.    *
  744.    * This is the gui_w32.c version (i think..)
  745. +  * Return INVALCOLOR when failed.
  746.    */
  747.   
  748.       guicolor_T
  749. ***************
  750. *** 2049,2055 ****
  751.       g = hex_digit( name[3] ) * 16 + hex_digit( name[4] );
  752.       b = hex_digit( name[5] ) * 16 + hex_digit( name[6] );
  753.       if( r < 0 || g < 0 || b < 0 )
  754. !         return( (guicolor_T) -1 );
  755.       return( RGB( r, g, b ) );
  756.       }
  757.   
  758. --- 2050,2056 ----
  759.       g = hex_digit( name[3] ) * 16 + hex_digit( name[4] );
  760.       b = hex_digit( name[5] ) * 16 + hex_digit( name[6] );
  761.       if( r < 0 || g < 0 || b < 0 )
  762. !         return INVALCOLOR;
  763.       return( RGB( r, g, b ) );
  764.       }
  765.   
  766. ***************
  767. *** 2070,2081 ****
  768.   
  769.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  770.       if (fname == NULL)
  771. !         return( (guicolor_T) -1 );
  772.   
  773.       fd = fopen((char *)fname, "rt");
  774.       vim_free(fname);
  775.       if (fd == NULL)
  776. !         return( (guicolor_T) -1 );
  777.   
  778.       while (!feof(fd))
  779.       {
  780. --- 2071,2082 ----
  781.   
  782.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  783.       if (fname == NULL)
  784. !         return INVALCOLOR;
  785.   
  786.       fd = fopen((char *)fname, "rt");
  787.       vim_free(fname);
  788.       if (fd == NULL)
  789. !         return INVALCOLOR;
  790.   
  791.       while (!feof(fd))
  792.       {
  793. ***************
  794. *** 2108,2114 ****
  795.       }
  796.   
  797.   
  798. !     return( (guicolor_T) -1 );
  799.   }
  800.   
  801.       void
  802. --- 2109,2115 ----
  803.       }
  804.   
  805.   
  806. !     return INVALCOLOR;
  807.   }
  808.   
  809.       void
  810. *** ../vim61.048/src/gui_riscos.c    Mon Mar 11 22:10:01 2002
  811. --- src/gui_riscos.c    Thu May  2 22:00:38 2002
  812. ***************
  813. *** 1090,1096 ****
  814.   
  815.   /*
  816.    * Return the Pixel value (colour) for the given colour name.
  817. !  * Return -1 for error.
  818.    * NB: I've changed Green for now, since it looked really sick
  819.    */
  820.       guicolor_T
  821. --- 1090,1096 ----
  822.   
  823.   /*
  824.    * Return the Pixel value (colour) for the given colour name.
  825. !  * Return INVALCOLOR for error.
  826.    * NB: I've changed Green for now, since it looked really sick
  827.    */
  828.       guicolor_T
  829. ***************
  830. *** 1165,1171 ****
  831.       int level = (255 * atoi(name + 4)) / 100;
  832.       return (guicolor_T) grgb(level, level, level);
  833.       }
  834. !     return (guicolor_T) -1;
  835.   }
  836.   
  837.   /*
  838. --- 1165,1171 ----
  839.       int level = (255 * atoi(name + 4)) / 100;
  840.       return (guicolor_T) grgb(level, level, level);
  841.       }
  842. !     return INVALCOLOR;
  843.   }
  844.   
  845.   /*
  846. *** ../vim61.048/src/gui_w16.c    Wed Jan  9 16:17:08 2002
  847. --- src/gui_w16.c    Thu May  2 22:23:59 2002
  848. ***************
  849. *** 460,466 ****
  850.   #endif
  851.       gui.border_width = 0;
  852.   
  853. !     gui.currBgColor = (long) -1;
  854.   
  855.       s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
  856.   
  857. --- 460,466 ----
  858.   #endif
  859.       gui.border_width = 0;
  860.   
  861. !     gui.currBgColor = INVALCOLOR;
  862.   
  863.       s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
  864.   
  865. *** ../vim61.048/src/gui_w32.c    Sun Apr 28 22:08:02 2002
  866. --- src/gui_w32.c    Sat May  4 22:20:06 2002
  867. ***************
  868. *** 1698,1704 ****
  869.        * becomes a problem. - webb.
  870.        */
  871.       static HBRUSH    hbr_cache[2] = {NULL, NULL};
  872. !     static guicolor_T    brush_color[2] = {-1, -1};
  873.       static int        brush_lru = 0;
  874.       HBRUSH        hbr;
  875.       RECT        rc;
  876. --- 1698,1704 ----
  877.        * becomes a problem. - webb.
  878.        */
  879.       static HBRUSH    hbr_cache[2] = {NULL, NULL};
  880. !     static guicolor_T    brush_color[2] = {INVALCOLOR, INVALCOLOR};
  881.       static int        brush_lru = 0;
  882.       HBRUSH        hbr;
  883.       RECT        rc;
  884. *** ../vim61.048/src/gui_w48.c    Wed May  1 21:20:47 2002
  885. --- src/gui_w48.c    Thu May  2 22:01:23 2002
  886. ***************
  887. *** 1124,1130 ****
  888.   }
  889.   /*
  890.    * Return the Pixel value (color) for the given color name.
  891. !  * Return -1 for error.
  892.    */
  893.       guicolor_T
  894.   gui_mch_get_color(char_u *name)
  895. --- 1124,1130 ----
  896.   }
  897.   /*
  898.    * Return the Pixel value (color) for the given color name.
  899. !  * Return INVALCOLOR for error.
  900.    */
  901.       guicolor_T
  902.   gui_mch_get_color(char_u *name)
  903. ***************
  904. *** 1226,1232 ****
  905.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  906.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  907.       if (r < 0 || g < 0 || b < 0)
  908. !         return (guicolor_T)-1;
  909.       return RGB(r, g, b);
  910.       }
  911.       else
  912. --- 1226,1232 ----
  913.       g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
  914.       b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
  915.       if (r < 0 || g < 0 || b < 0)
  916. !         return INVALCOLOR;
  917.       return RGB(r, g, b);
  918.       }
  919.       else
  920. ***************
  921. *** 1255,1266 ****
  922.   
  923.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  924.       if (fname == NULL)
  925. !         return (guicolor_T)-1;
  926.   
  927.       fd = fopen((char *)fname, "rt");
  928.       vim_free(fname);
  929.       if (fd == NULL)
  930. !         return (guicolor_T)-1;
  931.   
  932.       while (!feof(fd))
  933.       {
  934. --- 1255,1266 ----
  935.   
  936.       fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
  937.       if (fname == NULL)
  938. !         return INVALCOLOR;
  939.   
  940.       fd = fopen((char *)fname, "rt");
  941.       vim_free(fname);
  942.       if (fd == NULL)
  943. !         return INVALCOLOR;
  944.   
  945.       while (!feof(fd))
  946.       {
  947. ***************
  948. *** 1292,1298 ****
  949.       fclose(fd);
  950.       }
  951.   
  952. !     return (guicolor_T)-1;
  953.   }
  954.   /*
  955.    * Return OK if the key with the termcap name "name" is supported.
  956. --- 1292,1298 ----
  957.       fclose(fd);
  958.       }
  959.   
  960. !     return INVALCOLOR;
  961.   }
  962.   /*
  963.    * Return OK if the key with the termcap name "name" is supported.
  964. *** ../vim61.048/src/gui_x11.c    Fri May  3 22:02:55 2002
  965. --- src/gui_x11.c    Fri May  3 20:45:52 2002
  966. ***************
  967. *** 115,122 ****
  968.   static int fontset_ascent __ARGS((XFontSet fs));
  969.   #endif
  970.   
  971. ! static guicolor_T    prev_fg_color = (guicolor_T)-1;
  972. ! static guicolor_T    prev_bg_color = (guicolor_T)-1;
  973.   
  974.   #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
  975.   static XButtonPressedEvent last_mouse_event;
  976. --- 115,122 ----
  977.   static int fontset_ascent __ARGS((XFontSet fs));
  978.   #endif
  979.   
  980. ! static guicolor_T    prev_fg_color = INVALCOLOR;
  981. ! static guicolor_T    prev_bg_color = INVALCOLOR;
  982.   
  983.   #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
  984.   static XButtonPressedEvent last_mouse_event;
  985. ***************
  986. *** 2122,2128 ****
  987.   
  988.   /*
  989.    * Return the Pixel value (color) for the given color name.
  990. !  * Return -1 for error.
  991.    */
  992.       guicolor_T
  993.   gui_mch_get_color(reqname)
  994. --- 2122,2128 ----
  995.   
  996.   /*
  997.    * Return the Pixel value (color) for the given color name.
  998. !  * Return INVALCOLOR for error.
  999.    */
  1000.       guicolor_T
  1001.   gui_mch_get_color(reqname)
  1002. ***************
  1003. *** 2149,2155 ****
  1004.   
  1005.       /* can't do this when GUI not running */
  1006.       if (!gui.in_use || *reqname == NUL)
  1007. !     return (guicolor_T)-1;
  1008.   
  1009.       colormap = DefaultColormap(gui.dpy, XDefaultScreen(gui.dpy));
  1010.   
  1011. --- 2149,2155 ----
  1012.   
  1013.       /* can't do this when GUI not running */
  1014.       if (!gui.in_use || *reqname == NUL)
  1015. !     return INVALCOLOR;
  1016.   
  1017.       colormap = DefaultColormap(gui.dpy, XDefaultScreen(gui.dpy));
  1018.   
  1019. ***************
  1020. *** 2201,2207 ****
  1021.       }
  1022.       }
  1023.   
  1024. !     return (guicolor_T)-1;
  1025.   }
  1026.   
  1027.   /*
  1028. --- 2201,2207 ----
  1029.       }
  1030.       }
  1031.   
  1032. !     return INVALCOLOR;
  1033.   }
  1034.   
  1035.   /*
  1036. ***************
  1037. *** 2397,2403 ****
  1038.           XDrawString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
  1039.               TEXT_Y(row), (char *)s, len);
  1040.       }
  1041. !     else if (p_linespace
  1042.   #ifdef FEAT_XFONTSET
  1043.           || current_fontset != NULL
  1044.   #endif
  1045. --- 2397,2403 ----
  1046.           XDrawString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
  1047.               TEXT_Y(row), (char *)s, len);
  1048.       }
  1049. !     else if (p_linespace != 0
  1050.   #ifdef FEAT_XFONTSET
  1051.           || current_fontset != NULL
  1052.   #endif
  1053. *** ../vim61.048/src/mbyte.c    Sat May  4 12:20:40 2002
  1054. --- src/mbyte.c    Fri May  3 22:17:57 2002
  1055. ***************
  1056. *** 3043,3049 ****
  1057.       }
  1058.   # endif /* FEAT_XFONTSET */
  1059.   
  1060. !     if (xim_fg_color < 0)
  1061.       {
  1062.           xim_fg_color = gui.def_norm_pixel;
  1063.           xim_bg_color = gui.def_back_pixel;
  1064. --- 3043,3049 ----
  1065.       }
  1066.   # endif /* FEAT_XFONTSET */
  1067.   
  1068. !     if (xim_fg_color == INVALCOLOR)
  1069.       {
  1070.           xim_fg_color = gui.def_norm_pixel;
  1071.           xim_bg_color = gui.def_back_pixel;
  1072. ***************
  1073. *** 3085,3091 ****
  1074.   
  1075.       if (input_style & XIMPreeditPosition)
  1076.       {
  1077. !         if (xim_fg_color < 0)
  1078.           {
  1079.           xim_fg_color = gui.def_norm_pixel;
  1080.           xim_bg_color = gui.def_back_pixel;
  1081. --- 3085,3091 ----
  1082.   
  1083.       if (input_style & XIMPreeditPosition)
  1084.       {
  1085. !         if (xim_fg_color == INVALCOLOR)
  1086.           {
  1087.           xim_fg_color = gui.def_norm_pixel;
  1088.           xim_bg_color = gui.def_back_pixel;
  1089. *** ../vim61.048/src/syntax.c    Mon Apr  8 22:11:31 2002
  1090. --- src/syntax.c    Thu May  2 21:30:27 2002
  1091. ***************
  1092. *** 36,44 ****
  1093.   #ifdef FEAT_GUI
  1094.   /* for when using the GUI */
  1095.       int        sg_gui;        /* "gui=" highlighting attributes */
  1096. !     guicolor_T    sg_gui_fg;    /* GUI foreground color handle + 1 */
  1097.       char_u    *sg_gui_fg_name;/* GUI foreground color name */
  1098. !     guicolor_T    sg_gui_bg;    /* GUI background color handle + 1 */
  1099.       char_u    *sg_gui_bg_name;/* GUI background color name */
  1100.       GuiFont    sg_font;    /* GUI font handle */
  1101.   #ifdef FEAT_XFONTSET
  1102. --- 36,44 ----
  1103.   #ifdef FEAT_GUI
  1104.   /* for when using the GUI */
  1105.       int        sg_gui;        /* "gui=" highlighting attributes */
  1106. !     guicolor_T    sg_gui_fg;    /* GUI foreground color handle */
  1107.       char_u    *sg_gui_fg_name;/* GUI foreground color name */
  1108. !     guicolor_T    sg_gui_bg;    /* GUI background color handle */
  1109.       char_u    *sg_gui_bg_name;/* GUI background color name */
  1110.       GuiFont    sg_font;    /* GUI font handle */
  1111.   #ifdef FEAT_XFONTSET
  1112. ***************
  1113. *** 6647,6655 ****
  1114.           if (!init)
  1115.           HL_TABLE()[idx].sg_set |= SG_GUI;
  1116.   
  1117. !         /* Add one to the argument, to avoid zero */
  1118. !         i = color_name2handle(arg) + 1;
  1119. !         if (i > 0 || STRCMP(arg, "NONE") == 0 || !gui.in_use)
  1120.           {
  1121.           HL_TABLE()[idx].sg_gui_fg = i;
  1122.           vim_free(HL_TABLE()[idx].sg_gui_fg_name);
  1123. --- 6647,6654 ----
  1124.           if (!init)
  1125.           HL_TABLE()[idx].sg_set |= SG_GUI;
  1126.   
  1127. !         i = color_name2handle(arg);
  1128. !         if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !gui.in_use)
  1129.           {
  1130.           HL_TABLE()[idx].sg_gui_fg = i;
  1131.           vim_free(HL_TABLE()[idx].sg_gui_fg_name);
  1132. ***************
  1133. *** 6659,6670 ****
  1134.               HL_TABLE()[idx].sg_gui_fg_name = NULL;
  1135.   # ifdef FEAT_GUI_X11
  1136.           if (is_menu_group)
  1137. !             gui.menu_fg_pixel = i - 1;
  1138.           if (is_scrollbar_group)
  1139. !             gui.scroll_fg_pixel = i - 1;
  1140.   #  ifdef FEAT_BEVAL
  1141.           if (is_tooltip_group)
  1142. !             gui.tooltip_fg_pixel = i - 1;
  1143.   #  endif
  1144.           do_colors = TRUE;
  1145.   # endif
  1146. --- 6658,6669 ----
  1147.               HL_TABLE()[idx].sg_gui_fg_name = NULL;
  1148.   # ifdef FEAT_GUI_X11
  1149.           if (is_menu_group)
  1150. !             gui.menu_fg_pixel = i;
  1151.           if (is_scrollbar_group)
  1152. !             gui.scroll_fg_pixel = i;
  1153.   #  ifdef FEAT_BEVAL
  1154.           if (is_tooltip_group)
  1155. !             gui.tooltip_fg_pixel = i;
  1156.   #  endif
  1157.           do_colors = TRUE;
  1158.   # endif
  1159. ***************
  1160. *** 6680,6688 ****
  1161.           if (!init)
  1162.           HL_TABLE()[idx].sg_set |= SG_GUI;
  1163.   
  1164. !         /* Add one to the argument, to avoid zero */
  1165. !         i = color_name2handle(arg) + 1;
  1166. !         if (i > 0 || STRCMP(arg, "NONE") == 0 || !gui.in_use)
  1167.           {
  1168.           HL_TABLE()[idx].sg_gui_bg = i;
  1169.           vim_free(HL_TABLE()[idx].sg_gui_bg_name);
  1170. --- 6679,6686 ----
  1171.           if (!init)
  1172.           HL_TABLE()[idx].sg_set |= SG_GUI;
  1173.   
  1174. !         i = color_name2handle(arg);
  1175. !         if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !gui.in_use)
  1176.           {
  1177.           HL_TABLE()[idx].sg_gui_bg = i;
  1178.           vim_free(HL_TABLE()[idx].sg_gui_bg_name);
  1179. ***************
  1180. *** 6692,6703 ****
  1181.               HL_TABLE()[idx].sg_gui_bg_name = NULL;
  1182.   # ifdef FEAT_GUI_X11
  1183.           if (is_menu_group)
  1184. !             gui.menu_bg_pixel = i - 1;
  1185.           if (is_scrollbar_group)
  1186. !             gui.scroll_bg_pixel = i - 1;
  1187.   #  ifdef FEAT_BEVAL
  1188.           if (is_tooltip_group)
  1189. !             gui.tooltip_bg_pixel = i - 1;
  1190.   #  endif
  1191.           do_colors = TRUE;
  1192.   # endif
  1193. --- 6690,6701 ----
  1194.               HL_TABLE()[idx].sg_gui_bg_name = NULL;
  1195.   # ifdef FEAT_GUI_X11
  1196.           if (is_menu_group)
  1197. !             gui.menu_bg_pixel = i;
  1198.           if (is_scrollbar_group)
  1199. !             gui.scroll_bg_pixel = i;
  1200.   #  ifdef FEAT_BEVAL
  1201.           if (is_tooltip_group)
  1202. !             gui.tooltip_bg_pixel = i;
  1203.   #  endif
  1204.           do_colors = TRUE;
  1205.   # endif
  1206. ***************
  1207. *** 6915,6924 ****
  1208.       HL_TABLE()[idx].sg_cterm_attr = 0;
  1209.   #ifdef FEAT_GUI        /* in non-GUI fonts are simply ignored */
  1210.       HL_TABLE()[idx].sg_gui = 0;
  1211. !     HL_TABLE()[idx].sg_gui_fg = 0;
  1212.       vim_free(HL_TABLE()[idx].sg_gui_fg_name);
  1213.       HL_TABLE()[idx].sg_gui_fg_name = NULL;
  1214. !     HL_TABLE()[idx].sg_gui_bg = 0;
  1215.       vim_free(HL_TABLE()[idx].sg_gui_bg_name);
  1216.       HL_TABLE()[idx].sg_gui_bg_name = NULL;
  1217.       gui_mch_free_font(HL_TABLE()[idx].sg_font);
  1218. --- 6913,6922 ----
  1219.       HL_TABLE()[idx].sg_cterm_attr = 0;
  1220.   #ifdef FEAT_GUI        /* in non-GUI fonts are simply ignored */
  1221.       HL_TABLE()[idx].sg_gui = 0;
  1222. !     HL_TABLE()[idx].sg_gui_fg = INVALCOLOR;
  1223.       vim_free(HL_TABLE()[idx].sg_gui_fg_name);
  1224.       HL_TABLE()[idx].sg_gui_fg_name = NULL;
  1225. !     HL_TABLE()[idx].sg_gui_bg = INVALCOLOR;
  1226.       vim_free(HL_TABLE()[idx].sg_gui_bg_name);
  1227.       HL_TABLE()[idx].sg_gui_bg_name = NULL;
  1228.       gui_mch_free_font(HL_TABLE()[idx].sg_font);
  1229. ***************
  1230. *** 6999,7010 ****
  1231.       {
  1232.       gui_do_one_color(idx, do_menu, do_tooltip);
  1233.   
  1234. !     if (HL_TABLE()[idx].sg_gui_fg > 0)
  1235. !         *fgp = HL_TABLE()[idx].sg_gui_fg - 1;
  1236.       else if (use_norm)
  1237.           *fgp = gui.def_norm_pixel;
  1238. !     if (HL_TABLE()[idx].sg_gui_bg > 0)
  1239. !         *bgp = HL_TABLE()[idx].sg_gui_bg - 1;
  1240.       else if (use_norm)
  1241.           *bgp = gui.def_back_pixel;
  1242.       return TRUE;
  1243. --- 6997,7008 ----
  1244.       {
  1245.       gui_do_one_color(idx, do_menu, do_tooltip);
  1246.   
  1247. !     if (HL_TABLE()[idx].sg_gui_fg != INVALCOLOR)
  1248. !         *fgp = HL_TABLE()[idx].sg_gui_fg;
  1249.       else if (use_norm)
  1250.           *fgp = gui.def_norm_pixel;
  1251. !     if (HL_TABLE()[idx].sg_gui_bg != INVALCOLOR)
  1252. !         *bgp = HL_TABLE()[idx].sg_gui_bg;
  1253.       else if (use_norm)
  1254.           *bgp = gui.def_back_pixel;
  1255.       return TRUE;
  1256. ***************
  1257. *** 7094,7107 ****
  1258.   
  1259.   /*
  1260.    * Return the handle for a color name.
  1261. !  * Returns -1 when failed.
  1262.    */
  1263.       static guicolor_T
  1264.   color_name2handle(name)
  1265.       char_u  *name;
  1266.   {
  1267.       if (STRCMP(name, "NONE") == 0)
  1268. !     return (guicolor_T)-1;
  1269.   
  1270.       if (STRICMP(name, "fg") == 0 || STRICMP(name, "foreground") == 0)
  1271.       return gui.norm_pixel;
  1272. --- 7092,7105 ----
  1273.   
  1274.   /*
  1275.    * Return the handle for a color name.
  1276. !  * Returns INVALCOLOR when failed.
  1277.    */
  1278.       static guicolor_T
  1279.   color_name2handle(name)
  1280.       char_u  *name;
  1281.   {
  1282.       if (STRCMP(name, "NONE") == 0)
  1283. !     return INVALCOLOR;
  1284.   
  1285.       if (STRICMP(name, "fg") == 0 || STRICMP(name, "foreground") == 0)
  1286.       return gui.norm_pixel;
  1287. ***************
  1288. *** 7571,7579 ****
  1289.           color = HL_TABLE()[id - 1].sg_gui_fg;
  1290.           else
  1291.           color = HL_TABLE()[id - 1].sg_gui_bg;
  1292. !         if (color == 0)
  1293.           return NULL;
  1294. !         rgb = gui_mch_get_rgb(color - 1);
  1295.           sprintf((char *)buf, "#%02x%02x%02x",
  1296.                         (unsigned)(rgb >> 16),
  1297.                         (unsigned)(rgb >> 8) & 255,
  1298. --- 7569,7577 ----
  1299.           color = HL_TABLE()[id - 1].sg_gui_fg;
  1300.           else
  1301.           color = HL_TABLE()[id - 1].sg_gui_bg;
  1302. !         if (color == INVALCOLOR)
  1303.           return NULL;
  1304. !         rgb = gui_mch_get_rgb(color);
  1305.           sprintf((char *)buf, "#%02x%02x%02x",
  1306.                         (unsigned)(rgb >> 16),
  1307.                         (unsigned)(rgb >> 8) & 255,
  1308. ***************
  1309. *** 7619,7628 ****
  1310.       else
  1311.       color = HL_TABLE()[id - 1].sg_gui_bg;
  1312.   
  1313. !     if (color == 0)
  1314.       return 0L;
  1315.   
  1316. !     return gui_mch_get_rgb(color - 1);
  1317.   }
  1318.   #endif
  1319.   
  1320. --- 7617,7626 ----
  1321.       else
  1322.       color = HL_TABLE()[id - 1].sg_gui_bg;
  1323.   
  1324. !     if (color == INVALCOLOR)
  1325.       return 0L;
  1326.   
  1327. !     return gui_mch_get_rgb(color);
  1328.   }
  1329.   #endif
  1330.   
  1331. ***************
  1332. *** 7689,7696 ****
  1333.        * For the GUI mode: If there are other than "normal" highlighting
  1334.        * attributes, need to allocate an attr number.
  1335.        */
  1336. !     if (HL_TABLE()[idx].sg_gui_fg == 0
  1337. !         && HL_TABLE()[idx].sg_gui_bg == 0
  1338.           && HL_TABLE()[idx].sg_font == NOFONT
  1339.   # ifdef FEAT_XFONTSET
  1340.           && HL_TABLE()[idx].sg_fontset == NOFONTSET
  1341. --- 7687,7694 ----
  1342.        * For the GUI mode: If there are other than "normal" highlighting
  1343.        * attributes, need to allocate an attr number.
  1344.        */
  1345. !     if (HL_TABLE()[idx].sg_gui_fg == INVALCOLOR
  1346. !         && HL_TABLE()[idx].sg_gui_bg == INVALCOLOR
  1347.           && HL_TABLE()[idx].sg_font == NOFONT
  1348.   # ifdef FEAT_XFONTSET
  1349.           && HL_TABLE()[idx].sg_fontset == NOFONTSET
  1350. ***************
  1351. *** 7853,7858 ****
  1352. --- 7851,7858 ----
  1353.       vim_memset(&(HL_TABLE()[highlight_ga.ga_len]), 0, sizeof(struct hl_group));
  1354.       HL_TABLE()[highlight_ga.ga_len].sg_name = name;
  1355.       HL_TABLE()[highlight_ga.ga_len].sg_name_u = vim_strsave_up(name);
  1356. +     HL_TABLE()[highlight_ga.ga_len].sg_gui_bg = INVALCOLOR;
  1357. +     HL_TABLE()[highlight_ga.ga_len].sg_gui_fg = INVALCOLOR;
  1358.       ++highlight_ga.ga_len;
  1359.       --highlight_ga.ga_room;
  1360.   
  1361. ***************
  1362. *** 7904,7910 ****
  1363.   #ifdef FEAT_GUI
  1364.   /*
  1365.    * Get the GUI colors and attributes for a group ID.
  1366. !  * NOTE: the colors will be 0 when not set, the color plus one otherwise.
  1367.    */
  1368.       int
  1369.   syn_id2colors(hl_id, fgp, bgp)
  1370. --- 7904,7910 ----
  1371.   #ifdef FEAT_GUI
  1372.   /*
  1373.    * Get the GUI colors and attributes for a group ID.
  1374. !  * NOTE: the colors will be INVALCOLOR when not set, the color otherwise.
  1375.    */
  1376.       int
  1377.   syn_id2colors(hl_id, fgp, bgp)
  1378. ***************
  1379. *** 7987,7999 ****
  1380.       if (HL_TABLE()[idx].sg_gui_fg_name != NULL)
  1381.       {
  1382.       HL_TABLE()[idx].sg_gui_fg =
  1383. !         color_name2handle(HL_TABLE()[idx].sg_gui_fg_name) + 1;
  1384.       didit = TRUE;
  1385.       }
  1386.       if (HL_TABLE()[idx].sg_gui_bg_name != NULL)
  1387.       {
  1388.       HL_TABLE()[idx].sg_gui_bg =
  1389. !         color_name2handle(HL_TABLE()[idx].sg_gui_bg_name) + 1;
  1390.       didit = TRUE;
  1391.       }
  1392.       if (didit)    /* need to get a new attr number */
  1393. --- 7987,7999 ----
  1394.       if (HL_TABLE()[idx].sg_gui_fg_name != NULL)
  1395.       {
  1396.       HL_TABLE()[idx].sg_gui_fg =
  1397. !                 color_name2handle(HL_TABLE()[idx].sg_gui_fg_name);
  1398.       didit = TRUE;
  1399.       }
  1400.       if (HL_TABLE()[idx].sg_gui_bg_name != NULL)
  1401.       {
  1402.       HL_TABLE()[idx].sg_gui_bg =
  1403. !                 color_name2handle(HL_TABLE()[idx].sg_gui_bg_name);
  1404.       didit = TRUE;
  1405.       }
  1406.       if (didit)    /* need to get a new attr number */
  1407. *** ../vim61.048/src/version.c    Sat May  4 12:20:40 2002
  1408. --- src/version.c    Sat May  4 12:25:23 2002
  1409. ***************
  1410. *** 608,609 ****
  1411. --- 608,611 ----
  1412.   {   /* Add new patch number below this line */
  1413. + /**/
  1414. +     49,
  1415.   /**/
  1416.  
  1417. -- 
  1418. Females are strictly forbidden to appear unshaven in public.
  1419.         [real standing law in New Mexico, United States of America]
  1420.  
  1421.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  1422. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  1423. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  1424.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  1425.