diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-23 16:45:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-23 16:45:10 +0200 |
commit | 26af85d97ba1ed0ade6cdd41890ca04ed879b9c7 (patch) | |
tree | c34204de31a63785f2801279402fee3fc84ee9b2 /src/syntax.c | |
parent | eeac67788677a9ea81bcab69f81b4fc22c2adc00 (diff) | |
download | vim-git-26af85d97ba1ed0ade6cdd41890ca04ed879b9c7.tar.gz |
patch 8.0.0755: terminal window does not have colors in the GUIv8.0.0755
Problem: Terminal window does not have colors in the GUI.
Solution: Lookup the GUI color.
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c index 4cd753c1e..6fdc2af2c 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -7908,7 +7908,7 @@ do_highlight( HL_TABLE()[idx].sg_gui_fg = i; # endif vim_free(HL_TABLE()[idx].sg_gui_fg_name); - if (STRCMP(arg, "NONE")) + if (STRCMP(arg, "NONE") != 0) HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg); else HL_TABLE()[idx].sg_gui_fg_name = NULL; @@ -8789,12 +8789,31 @@ get_cterm_attr_idx(int attr, int fg, int bg) { attrentry_T at_en; + vim_memset(&at_en, 0, sizeof(attrentry_T)); at_en.ae_attr = attr; at_en.ae_u.cterm.fg_color = fg; at_en.ae_u.cterm.bg_color = bg; return get_attr_entry(&cterm_attr_table, &at_en); } +#if defined(FEAT_GUI) || defined(PROTO) +/* + * Get an attribute index for a cterm entry. + * Uses an existing entry when possible or adds one when needed. + */ + int +get_gui_attr_idx(int attr, guicolor_T fg, guicolor_T bg) +{ + attrentry_T at_en; + + vim_memset(&at_en, 0, sizeof(attrentry_T)); + at_en.ae_attr = attr; + at_en.ae_u.gui.fg_color = fg; + at_en.ae_u.gui.bg_color = bg; + return get_attr_entry(&gui_attr_table, &at_en); +} +#endif + /* * Clear all highlight tables. */ |