comparison 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
comparison
equal deleted inserted replaced
13313:97fb19f36653 13314:65c3e8259124
8925 get_cterm_attr_idx(int attr, int fg, int bg) 8925 get_cterm_attr_idx(int attr, int fg, int bg)
8926 { 8926 {
8927 attrentry_T at_en; 8927 attrentry_T at_en;
8928 8928
8929 vim_memset(&at_en, 0, sizeof(attrentry_T)); 8929 vim_memset(&at_en, 0, sizeof(attrentry_T));
8930 #ifdef FEAT_TERMGUICOLORS
8931 at_en.ae_u.cterm.fg_rgb = INVALCOLOR;
8932 at_en.ae_u.cterm.bg_rgb = INVALCOLOR;
8933 #endif
8930 at_en.ae_attr = attr; 8934 at_en.ae_attr = attr;
8931 at_en.ae_u.cterm.fg_color = fg; 8935 at_en.ae_u.cterm.fg_color = fg;
8932 at_en.ae_u.cterm.bg_color = bg; 8936 at_en.ae_u.cterm.bg_color = bg;
8933 return get_attr_entry(&cterm_attr_table, &at_en); 8937 return get_attr_entry(&cterm_attr_table, &at_en);
8934 } 8938 }
9564 { 9568 {
9565 at_en.ae_attr = sgp->sg_cterm; 9569 at_en.ae_attr = sgp->sg_cterm;
9566 at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg; 9570 at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
9567 at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg; 9571 at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
9568 # ifdef FEAT_TERMGUICOLORS 9572 # ifdef FEAT_TERMGUICOLORS
9573 # ifdef WIN3264
9574 {
9575 int id;
9576 guicolor_T fg, bg;
9577
9578 id = syn_name2id((char_u *)"Normal");
9579 if (id > 0)
9580 {
9581 syn_id2colors(id, &fg, &bg);
9582 if (sgp->sg_gui_fg == INVALCOLOR)
9583 sgp->sg_gui_fg = fg;
9584 if (sgp->sg_gui_bg == INVALCOLOR)
9585 sgp->sg_gui_bg = bg;
9586 }
9587
9588 }
9589 # endif
9569 at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg); 9590 at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
9570 at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg); 9591 at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
9571 # endif 9592 # endif
9572 sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en); 9593 sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en);
9573 } 9594 }