diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-02 21:35:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-02 21:35:31 +0100 |
commit | a050b9471c66b383ed674bfd57ac78016199d972 (patch) | |
tree | 1d6ec4d0a775fa46b85f3870e886975c2a6b132b /src/screen.c | |
parent | 54c8d229f54e36e89fcd5d84e523fd894d018024 (diff) |
patch 8.1.2382: MS-Windows: When using VTP bold+inverse doesn't workv8.1.2382
Problem: MS-Windows: When using VTP bold+inverse doesn't work.
Solution: Compare with the default colors. (Nobuhiro Takasaki, closes #5303)
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c index 4a70295187..17b1ff2192 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1777,6 +1777,33 @@ screen_start_highlight(int attr) else attr = aep->ae_attr; } +#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS) + if (use_vtp()) + { + guicolor_T defguifg, defguibg; + int defctermfg, defctermbg; + + // If FG and BG are unset, the color is undefined when + // BOLD+INVERSE. Use Normal as the default value. + get_default_console_color(&defctermfg, &defctermbg, &defguifg, + &defguibg); + + if (p_tgc) + { + if (aep == NULL || COLOR_INVALID(aep->ae_u.cterm.fg_rgb)) + term_fg_rgb_color(defguifg); + if (aep == NULL || COLOR_INVALID(aep->ae_u.cterm.bg_rgb)) + term_bg_rgb_color(defguibg); + } + else if (t_colors >= 256) + { + if (aep == NULL || aep->ae_u.cterm.fg_color == 0) + term_fg_color(defctermfg); + if (aep == NULL || aep->ae_u.cterm.bg_color == 0) + term_bg_color(defctermbg); + } + } +#endif if ((attr & HL_BOLD) && *T_MD != NUL) /* bold */ out_str(T_MD); else if (aep != NULL && cterm_normal_fg_bold && ( |