summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-04 15:37:46 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-04 15:37:46 +0200
commit4b974d54434b8020771be7225da94648e9ec961a (patch)
treee3a471a09ed2eb15c70d3fa645b3efe628aec8ea
parent28a8193e3113f676f89fb6312b099d849df881d3 (diff)
patch 8.0.0610: the screen is redrawn when default 'background' is detectedv8.0.0610
Problem: The screen is redrawn when t_BG is set and used to detect the value for 'background'. Solution: Don't redraw when the value of 'background' didn't change.
-rw-r--r--src/term.c18
-rw-r--r--src/version.c2
2 files changed, 14 insertions, 6 deletions
diff --git a/src/term.c b/src/term.c
index d23d8cba61..fb6b59e962 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4385,14 +4385,20 @@ check_termcode(
if (i - j >= 21 && STRNCMP(tp + j + 3, "rgb:", 4) == 0
&& tp[j + 11] == '/' && tp[j + 16] == '/'
&& !option_was_set((char_u *)"bg"))
- {/* TODO: don't set option when already the right value */
+ {
+ char *newval = (3 * '6' < tp[j+7] + tp[j+12]
+ + tp[j+17]) ? "light" : "dark";
+
LOG_TR("Received RBG");
rbg_status = RBG_GOT;
- set_option_value((char_u *)"bg", 0L, (char_u *)(
- (3 * '6' < tp[j+7] + tp[j+12] + tp[j+17])
- ? "light" : "dark"), 0);
- reset_option_was_set((char_u *)"bg");
- redraw_asap(CLEAR);
+ if (STRCMP(p_bg, newval) != 0)
+ {
+ /* value differs, apply it */
+ set_option_value((char_u *)"bg", 0L,
+ (char_u *)newval, 0);
+ reset_option_was_set((char_u *)"bg");
+ redraw_asap(CLEAR);
+ }
}
/* got finished code: consume it */
diff --git a/src/version.c b/src/version.c
index 8c5679e543..bb3581c0bf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 610,
+/**/
609,
/**/
608,