mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.1102: terminal window does not use Normal colors
Problem: Terminal window does not use Normal colors. Solution: For the GUI and when 'termguicolors' is enabled, use the actual foreground and background colors for the terminal. (Yasuhiro Matsumoto, closes #2067) Use the "Terminal" highlight group if defined.
This commit is contained in:
15
src/syntax.c
15
src/syntax.c
@@ -9709,7 +9709,7 @@ syn_id2attr(int hl_id)
|
||||
return attr;
|
||||
}
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
|
||||
/*
|
||||
* Get the GUI colors and attributes for a group ID.
|
||||
* NOTE: the colors will be INVALCOLOR when not set, the color otherwise.
|
||||
@@ -9728,6 +9728,19 @@ syn_id2colors(int hl_id, guicolor_T *fgp, guicolor_T *bgp)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_TERMINAL) || defined(PROT)
|
||||
void
|
||||
syn_id2cterm_bg(int hl_id, int *fgp, int *bgp)
|
||||
{
|
||||
struct hl_group *sgp;
|
||||
|
||||
hl_id = syn_get_final_id(hl_id);
|
||||
sgp = &HL_TABLE()[hl_id - 1]; /* index is ID minus one */
|
||||
*fgp = sgp->sg_cterm_fg - 1;
|
||||
*bgp = sgp->sg_cterm_bg - 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Translate a group ID to the final group ID (following links).
|
||||
*/
|
||||
|
Reference in New Issue
Block a user