]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.418 v7.2.418
authorBram Moolenaar <Bram@vim.org>
Thu, 13 May 2010 13:40:30 +0000 (15:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 May 2010 13:40:30 +0000 (15:40 +0200)
Problem:    Vim tries to set the background or foreground color in a terminal
            to -1.  (Graywh)  Happens with ":hi Normal ctermbg=NONE".
Solution:   When resetting the foreground or background color don't set the
            color, let the clear screen code do that.

src/syntax.c
src/version.c

index 9a24d43016f6e16cd2bead3fe93ab931eb15803a..1eeb9bc8b3e8d58760d6fddc4711448ca5d1ee2b 100644 (file)
@@ -7136,7 +7136,8 @@ do_highlight(line, forceit, init)
                    }
                }
            }
-           /* Add one to the argument, to avoid zero */
+           /* Add one to the argument, to avoid zero.  Zero is used for
+            * "NONE", then "color" is -1. */
            if (key[5] == 'F')
            {
                HL_TABLE()[idx].sg_cterm_fg = color + 1;
@@ -7150,7 +7151,7 @@ do_highlight(line, forceit, init)
 #endif
                    {
                        must_redraw = CLEAR;
-                       if (termcap_active)
+                       if (termcap_active && color >= 0)
                            term_fg_color(color);
                    }
                }
@@ -7167,16 +7168,21 @@ do_highlight(line, forceit, init)
 #endif
                    {
                        must_redraw = CLEAR;
-                       if (termcap_active)
-                           term_bg_color(color);
-                       if (t_colors < 16)
-                           i = (color == 0 || color == 4);
-                       else
-                           i = (color < 7 || color == 8);
-                       /* Set the 'background' option if the value is wrong. */
-                       if (i != (*p_bg == 'd'))
-                           set_option_value((char_u *)"bg", 0L,
-                                i ? (char_u *)"dark" : (char_u *)"light", 0);
+                       if (color >= 0)
+                       {
+                           if (termcap_active)
+                               term_bg_color(color);
+                           if (t_colors < 16)
+                               i = (color == 0 || color == 4);
+                           else
+                               i = (color < 7 || color == 8);
+                           /* Set the 'background' option if the value is
+                            * wrong. */
+                           if (i != (*p_bg == 'd'))
+                               set_option_value((char_u *)"bg", 0L,
+                                       i ?  (char_u *)"dark"
+                                         : (char_u *)"light", 0);
+                       }
                    }
                }
            }
index 1f1263b688dc7b9a0a9c3f96310a0f090de05eb8..f44031f4254d32e6a4869304220a6ebc5a3b2422 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    418,
 /**/
     417,
 /**/