summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-23 18:07:56 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-23 18:07:56 +0200
commit065f41c8143271d1af7c8f5d14a59e29bf7ecdf3 (patch)
tree882fdc9e6dcafd380a6efce8670f0c2345cde44a /src/syntax.c
parent43da3e36b21b9df20e4b2f380df76bbc7e91a965 (diff)
downloadvim-git-065f41c8143271d1af7c8f5d14a59e29bf7ecdf3.tar.gz
patch 8.0.0760: terminal window colors wrong with 'termguicolors'v8.0.0760
Problem: Terminal window colors wrong with 'termguicolors'. Solution: Add 'termguicolors' support.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 6fdc2af2c..e445fba0e 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8796,6 +8796,24 @@ get_cterm_attr_idx(int attr, int fg, int bg)
return get_attr_entry(&cterm_attr_table, &at_en);
}
+#if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
+/*
+ * Get an attribute index for a 'termguicolors' entry.
+ * Uses an existing entry when possible or adds one when needed.
+ */
+ int
+get_tgc_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.cterm.fg_rgb = fg;
+ at_en.ae_u.cterm.bg_rgb = bg;
+ return get_attr_entry(&cterm_attr_table, &at_en);
+}
+#endif
+
#if defined(FEAT_GUI) || defined(PROTO)
/*
* Get an attribute index for a cterm entry.