0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

updated for version 7.2.418

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.
This commit is contained in:
Bram Moolenaar
2010-05-13 15:40:30 +02:00
parent ae61bcf0ab
commit ccbab93b42
2 changed files with 20 additions and 12 deletions

View 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') if (key[5] == 'F')
{ {
HL_TABLE()[idx].sg_cterm_fg = color + 1; HL_TABLE()[idx].sg_cterm_fg = color + 1;
@@ -7150,7 +7151,7 @@ do_highlight(line, forceit, init)
#endif #endif
{ {
must_redraw = CLEAR; must_redraw = CLEAR;
if (termcap_active) if (termcap_active && color >= 0)
term_fg_color(color); term_fg_color(color);
} }
} }
@@ -7167,16 +7168,21 @@ do_highlight(line, forceit, init)
#endif #endif
{ {
must_redraw = CLEAR; must_redraw = CLEAR;
if (color >= 0)
{
if (termcap_active) if (termcap_active)
term_bg_color(color); term_bg_color(color);
if (t_colors < 16) if (t_colors < 16)
i = (color == 0 || color == 4); i = (color == 0 || color == 4);
else else
i = (color < 7 || color == 8); i = (color < 7 || color == 8);
/* Set the 'background' option if the value is wrong. */ /* Set the 'background' option if the value is
* wrong. */
if (i != (*p_bg == 'd')) if (i != (*p_bg == 'd'))
set_option_value((char_u *)"bg", 0L, set_option_value((char_u *)"bg", 0L,
i ? (char_u *)"dark" : (char_u *)"light", 0); i ? (char_u *)"dark"
: (char_u *)"light", 0);
}
} }
} }
} }

View File

@@ -681,6 +681,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
418,
/**/ /**/
417, 417,
/**/ /**/