summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-12-01 21:07:20 +0100
committerBram Moolenaar <Bram@vim.org>2017-12-01 21:07:20 +0100
commita7c54cfcf825e8e99db03f4ccdb1a32cd0714c52 (patch)
tree2967da1b4011b77a7ea95da8d06f539dd675c7e7 /src/syntax.c
parent97ce419201421f65f4764549ed80307a7ef9c7a6 (diff)
downloadvim-git-a7c54cfcf825e8e99db03f4ccdb1a32cd0714c52.tar.gz
patch 8.0.1362: terminal window colors wrong when using Terminal highlightingv8.0.1362
Problem: Terminal window colors wrong when using Terminal highlighting. Solution: Set ansi_index when setting the default color. Also cache the color index for Terminal. (Ozaki Kiichi, closes #2393)
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index d733f5bcf..d247e0d16 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -7391,6 +7391,9 @@ do_highlight(
int error = FALSE;
int color;
int is_normal_group = FALSE; /* "Normal" group */
+#ifdef FEAT_TERMINAL
+ int is_terminal_group = FALSE; /* "Terminal" group */
+#endif
#ifdef FEAT_GUI_X11
int is_menu_group = FALSE; /* "Menu" group */
int is_scrollbar_group = FALSE; /* "Scrollbar" group */
@@ -7616,6 +7619,10 @@ do_highlight(
if (STRCMP(HL_TABLE()[idx].sg_name_u, "NORMAL") == 0)
is_normal_group = TRUE;
+#ifdef FEAT_TERMINAL
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "TERMINAL") == 0)
+ is_terminal_group = TRUE;
+#endif
#ifdef FEAT_GUI_X11
else if (STRCMP(HL_TABLE()[idx].sg_name_u, "MENU") == 0)
is_menu_group = TRUE;
@@ -8239,6 +8246,11 @@ do_highlight(
}
#endif
}
+#ifdef FEAT_TERMINAL
+ else if (is_terminal_group)
+ set_terminal_default_colors(
+ HL_TABLE()[idx].sg_cterm_fg, HL_TABLE()[idx].sg_cterm_bg);
+#endif
#ifdef FEAT_GUI_X11
# ifdef FEAT_MENU
else if (is_menu_group)