patch 8.0.1362: terminal window colors wrong when using Terminal highlighting
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)
diff --git a/src/syntax.c b/src/syntax.c
index d733f5b..d247e0d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -7391,6 +7391,9 @@
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 @@
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 @@
}
#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)