diff src/syntax.c @ 13314:65c3e8259124 v8.0.1531

patch 8.0.1531: cannot use 24 bit colors in MS-Windows console commit https://github.com/vim/vim/commit/cafafb381a04e33f3ce9cd15dd9f94b73226831f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 22 21:07:09 2018 +0100 patch 8.0.1531: cannot use 24 bit colors in MS-Windows console Problem: Cannot use 24 bit colors in MS-Windows console. Solution: Add support for vcon. (Nobuhiro Takasaki, Ken Takasaki, fixes #1270, fixes #2060)
author Christian Brabandt <cb@256bit.org>
date Thu, 22 Feb 2018 21:15:05 +0100
parents ae312df8d0ab
children b4e7082de11d
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8927,6 +8927,10 @@ get_cterm_attr_idx(int attr, int fg, int
     attrentry_T		at_en;
 
     vim_memset(&at_en, 0, sizeof(attrentry_T));
+#ifdef FEAT_TERMGUICOLORS
+    at_en.ae_u.cterm.fg_rgb = INVALCOLOR;
+    at_en.ae_u.cterm.bg_rgb = INVALCOLOR;
+#endif
     at_en.ae_attr = attr;
     at_en.ae_u.cterm.fg_color = fg;
     at_en.ae_u.cterm.bg_color = bg;
@@ -9566,6 +9570,23 @@ set_hl_attr(
 	at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
 	at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
 # ifdef FEAT_TERMGUICOLORS
+#  ifdef WIN3264
+	{
+	    int id;
+	    guicolor_T fg, bg;
+
+	    id = syn_name2id((char_u *)"Normal");
+	    if (id > 0)
+	    {
+		syn_id2colors(id, &fg, &bg);
+		if (sgp->sg_gui_fg == INVALCOLOR)
+		    sgp->sg_gui_fg = fg;
+		if (sgp->sg_gui_bg == INVALCOLOR)
+		    sgp->sg_gui_bg = bg;
+	    }
+
+	}
+#  endif
 	at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
 	at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
 # endif