To: vim_dev@googlegroups.com Subject: Patch 8.0.0610 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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. Files: src/term.c. *** ../vim-8.0.0609/src/term.c 2017-04-20 19:44:05.401983093 +0200 --- src/term.c 2017-05-24 09:27:08.322263537 +0200 *************** *** 4385,4398 **** 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 */ 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); } /* got finished code: consume it */ --- 4387,4406 ---- if (i - j >= 21 && STRNCMP(tp + j + 3, "rgb:", 4) == 0 && tp[j + 11] == '/' && tp[j + 16] == '/' && !option_was_set((char_u *)"bg")) ! { ! char *newval = (3 * '6' < tp[j+7] + tp[j+12] ! + tp[j+17]) ? "light" : "dark"; ! LOG_TR("Received RBG"); rbg_status = RBG_GOT; ! 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 */ *** ../vim-8.0.0609/src/version.c 2017-06-04 15:33:44.541488336 +0200 --- src/version.c 2017-06-04 15:35:27.552774430 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 610, /**/ -- I learned the customs and mannerisms of engineers by observing them, much the way Jane Goodall learned about the great apes, but without the hassle of grooming. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///