From a7c54cfcf825e8e99db03f4ccdb1a32cd0714c52 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 1 Dec 2017 21:07:20 +0100 Subject: 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) --- src/syntax.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/syntax.c') 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) -- cgit v1.2.1