summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-22 21:07:09 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-22 21:07:09 +0100
commitcafafb381a04e33f3ce9cd15dd9f94b73226831f (patch)
tree39c0444924dc20b2715e102a8e8ea34a11684ab6 /src/syntax.c
parent19eb6658eced1b1ce3d1097187ee28c28e352f2e (diff)
downloadvim-git-cafafb381a04e33f3ce9cd15dd9f94b73226831f.tar.gz
patch 8.0.1531: cannot use 24 bit colors in MS-Windows consolev8.0.1531
Problem: Cannot use 24 bit colors in MS-Windows console. Solution: Add support for vcon. (Nobuhiro Takasaki, Ken Takasaki, fixes #1270, fixes #2060)
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index fcffdbf8a..79b2796d2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8927,6 +8927,10 @@ get_cterm_attr_idx(int attr, int fg, int bg)
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