To: vim_dev@googlegroups.com Subject: Patch 8.0.1146 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1146 Problem: Redraw when highlight is set with same names. (Ozaki Kiichi) Solution: Only free and save a name when it changed. (closes #2120) Files: src/syntax.c *** ../vim-8.0.1145/src/syntax.c 2017-09-22 13:53:31.824213326 +0200 --- src/syntax.c 2017-09-25 22:39:46.127700128 +0200 *************** *** 7969,7974 **** --- 7969,7976 ---- } else if (STRCMP(key, "GUIFG") == 0) { + char_u **namep = &HL_TABLE()[idx].sg_gui_fg_name; + #if defined(FEAT_GUI) || defined(FEAT_EVAL) if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI)) { *************** *** 7982,8003 **** { HL_TABLE()[idx].sg_gui_fg = i; # endif ! vim_free(HL_TABLE()[idx].sg_gui_fg_name); ! if (STRCMP(arg, "NONE") != 0) ! HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg); ! else ! HL_TABLE()[idx].sg_gui_fg_name = NULL; # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 ! if (is_menu_group) gui.menu_fg_pixel = i; ! if (is_scrollbar_group) gui.scroll_fg_pixel = i; # ifdef FEAT_BEVAL ! if (is_tooltip_group) gui.tooltip_fg_pixel = i; # endif - do_colors = TRUE; # endif } # endif --- 7984,8016 ---- { HL_TABLE()[idx].sg_gui_fg = i; # endif ! if (*namep == NULL || STRCMP(*namep, arg) != 0) ! { ! vim_free(*namep); ! if (STRCMP(arg, "NONE") != 0) ! *namep = vim_strsave(arg); ! else ! *namep = NULL; ! } # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 ! if (is_menu_group && gui.menu_fg_pixel != i) ! { gui.menu_fg_pixel = i; ! do_colors = TRUE; ! } ! if (is_scrollbar_group && gui.scroll_fg_pixel != i) ! { gui.scroll_fg_pixel = i; + do_colors = TRUE; + } # ifdef FEAT_BEVAL ! if (is_tooltip_group && gui.tooltip_fg_pixel != i) ! { gui.tooltip_fg_pixel = i; + do_colors = TRUE; + } # endif # endif } # endif *************** *** 8006,8011 **** --- 8019,8026 ---- } else if (STRCMP(key, "GUIBG") == 0) { + char_u **namep = &HL_TABLE()[idx].sg_gui_bg_name; + #if defined(FEAT_GUI) || defined(FEAT_EVAL) if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI)) { *************** *** 8019,8040 **** { HL_TABLE()[idx].sg_gui_bg = i; # endif ! vim_free(HL_TABLE()[idx].sg_gui_bg_name); ! if (STRCMP(arg, "NONE") != 0) ! HL_TABLE()[idx].sg_gui_bg_name = vim_strsave(arg); ! else ! HL_TABLE()[idx].sg_gui_bg_name = NULL; # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 ! if (is_menu_group) gui.menu_bg_pixel = i; ! if (is_scrollbar_group) gui.scroll_bg_pixel = i; # ifdef FEAT_BEVAL ! if (is_tooltip_group) gui.tooltip_bg_pixel = i; # endif - do_colors = TRUE; # endif } # endif --- 8034,8066 ---- { HL_TABLE()[idx].sg_gui_bg = i; # endif ! if (*namep == NULL || STRCMP(*namep, arg) != 0) ! { ! vim_free(*namep); ! if (STRCMP(arg, "NONE") != 0) ! *namep = vim_strsave(arg); ! else ! *namep = NULL; ! } # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) # ifdef FEAT_GUI_X11 ! if (is_menu_group && gui.menu_bg_pixel != i) ! { gui.menu_bg_pixel = i; ! do_colors = TRUE; ! } ! if (is_scrollbar_group && gui.scroll_bg_pixel != i) ! { gui.scroll_bg_pixel = i; + do_colors = TRUE; + } # ifdef FEAT_BEVAL ! if (is_tooltip_group && gui.tooltip_bg_pixel != i) ! { gui.tooltip_bg_pixel = i; + do_colors = TRUE; + } # endif # endif } # endif *************** *** 8043,8048 **** --- 8069,8076 ---- } else if (STRCMP(key, "GUISP") == 0) { + char_u **namep = &HL_TABLE()[idx].sg_gui_sp_name; + #if defined(FEAT_GUI) || defined(FEAT_EVAL) if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI)) { *************** *** 8055,8065 **** { HL_TABLE()[idx].sg_gui_sp = i; # endif ! vim_free(HL_TABLE()[idx].sg_gui_sp_name); ! if (STRCMP(arg, "NONE") != 0) ! HL_TABLE()[idx].sg_gui_sp_name = vim_strsave(arg); ! else ! HL_TABLE()[idx].sg_gui_sp_name = NULL; # ifdef FEAT_GUI } # endif --- 8083,8096 ---- { HL_TABLE()[idx].sg_gui_sp = i; # endif ! if (*namep == NULL || STRCMP(*namep, arg) != 0) ! { ! vim_free(*namep); ! if (STRCMP(arg, "NONE") != 0) ! *namep = vim_strsave(arg); ! else ! *namep = NULL; ! } # ifdef FEAT_GUI } # endif *** ../vim-8.0.1145/src/version.c 2017-09-25 22:02:23.877637108 +0200 --- src/version.c 2017-09-25 22:40:57.511256826 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1146, /**/ -- Some of the well known MS-Windows errors: EHUH Unexpected error EUSER User error, not our fault! EGOD Horrible problem, god knows what has happened EERR Errornous error: nothing wrong /// 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 ///