0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.0.1543: with 'termguicolors' Normal color doesn't work correctly

Problem:    With 'termguicolors' Normal color doesn't work correctly.
Solution:   Set cterm_normal_bg_gui_color and cterm_normal_fg_color always.
            (Kazunobu Kuriyama, closes #981, closes #2332)
This commit is contained in:
Bram Moolenaar 2018-02-27 13:04:59 +01:00
parent 9271d058c9
commit 33ef5bb0e4
2 changed files with 26 additions and 26 deletions

View File

@ -8411,7 +8411,7 @@ highlight_clear(int idx)
void void
set_normal_colors(void) set_normal_colors(void)
{ {
#ifdef FEAT_GUI # ifdef FEAT_GUI
# ifdef FEAT_TERMGUICOLORS # ifdef FEAT_TERMGUICOLORS
if (gui.in_use) if (gui.in_use)
# endif # endif
@ -8453,8 +8453,8 @@ set_normal_colors(void)
} }
# endif # endif
} }
#endif # endif
#ifdef FEAT_TERMGUICOLORS # ifdef FEAT_TERMGUICOLORS
# ifdef FEAT_GUI # ifdef FEAT_GUI
else else
# endif # endif
@ -8466,19 +8466,20 @@ set_normal_colors(void)
{ {
gui_do_one_color(idx, FALSE, FALSE); gui_do_one_color(idx, FALSE, FALSE);
if (HL_TABLE()[idx].sg_gui_fg != INVALCOLOR) /* If the normal fg or bg color changed a complete redraw is
* required. */
if (cterm_normal_fg_gui_color != HL_TABLE()[idx].sg_gui_fg
|| cterm_normal_bg_gui_color != HL_TABLE()[idx].sg_gui_bg)
{ {
/* if the GUI color is INVALCOLOR then we use the default cterm
* color */
cterm_normal_fg_gui_color = HL_TABLE()[idx].sg_gui_fg; cterm_normal_fg_gui_color = HL_TABLE()[idx].sg_gui_fg;
must_redraw = CLEAR;
}
if (HL_TABLE()[idx].sg_gui_bg != INVALCOLOR)
{
cterm_normal_bg_gui_color = HL_TABLE()[idx].sg_gui_bg; cterm_normal_bg_gui_color = HL_TABLE()[idx].sg_gui_bg;
must_redraw = CLEAR; must_redraw = CLEAR;
} }
} }
} }
#endif # endif
} }
#endif #endif
@ -9867,9 +9868,10 @@ syn_get_final_id(int hl_id)
return hl_id; return hl_id;
} }
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
/* /*
* Call this function just after the GUI has started. * Call this function just after the GUI has started.
* Also called when 'termguicolors' was set, gui.in_use will be FALSE then.
* It finds the font and color handles for the highlighting groups. * It finds the font and color handles for the highlighting groups.
*/ */
void void
@ -9878,12 +9880,8 @@ highlight_gui_started(void)
int idx; int idx;
/* First get the colors from the "Normal" and "Menu" group, if set */ /* First get the colors from the "Normal" and "Menu" group, if set */
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
# ifdef FEAT_TERMGUICOLORS
if (USE_24BIT) if (USE_24BIT)
# endif
set_normal_colors(); set_normal_colors();
# endif
for (idx = 0; idx < highlight_ga.ga_len; ++idx) for (idx = 0; idx < highlight_ga.ga_len; ++idx)
gui_do_one_color(idx, FALSE, FALSE); gui_do_one_color(idx, FALSE, FALSE);

View File

@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1543,
/**/ /**/
1542, 1542,
/**/ /**/