summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-13 15:40:30 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-13 15:40:30 +0200
commitccbab93b42973b236b6c83513b347adbd4215245 (patch)
tree10f31a961452568678863b40f298ff5f185ba080
parentae61bcf0abf46aa5152acaa162cfbaa9fc6001d0 (diff)
downloadvim-git-ccbab93b42973b236b6c83513b347adbd4215245.tar.gz
updated for version 7.2.418v7.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.
-rw-r--r--src/syntax.c30
-rw-r--r--src/version.c2
2 files changed, 20 insertions, 12 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 9a24d4301..1eeb9bc8b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -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);
+ }
}
}
}
diff --git a/src/version.c b/src/version.c
index 1f1263b68..f44031f42 100644
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 418,
+/**/
417,
/**/
416,