0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0755: terminal window does not have colors in the GUI

Problem:    Terminal window does not have colors in the GUI.
Solution:   Lookup the GUI color.
This commit is contained in:
Bram Moolenaar
2017-07-23 16:45:10 +02:00
parent eeac677886
commit 26af85d97b
16 changed files with 100 additions and 14 deletions

View File

@@ -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.
*/