forked from aniani/vim
patch 9.0.0344: MS-Windows: background color wrong in Console
Problem: MS-Windows: background color wrong in Console. Solution: Figure out the default console background color. (Yasuhiro Matsumoto, issue #10310)
This commit is contained in:
parent
5d09a401ec
commit
e42c8dae32
@ -213,6 +213,7 @@ static int g_color_index_bg = 0;
|
|||||||
static int g_color_index_fg = 7;
|
static int g_color_index_fg = 7;
|
||||||
|
|
||||||
# ifdef FEAT_TERMGUICOLORS
|
# ifdef FEAT_TERMGUICOLORS
|
||||||
|
static int default_console_color_bg = 0x000000; // black
|
||||||
static int default_console_color_fg = 0xc0c0c0; // white
|
static int default_console_color_fg = 0xc0c0c0; // white
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -7878,6 +7879,13 @@ vtp_init(void)
|
|||||||
store_console_fg_rgb = save_console_fg_rgb;
|
store_console_fg_rgb = save_console_fg_rgb;
|
||||||
|
|
||||||
# ifdef FEAT_TERMGUICOLORS
|
# ifdef FEAT_TERMGUICOLORS
|
||||||
|
if (!USE_WT)
|
||||||
|
{
|
||||||
|
COLORREF bg;
|
||||||
|
bg = (COLORREF)csbi.ColorTable[g_color_index_bg];
|
||||||
|
bg = (GetRValue(bg) << 16) | (GetGValue(bg) << 8) | GetBValue(bg);
|
||||||
|
default_console_color_bg = bg;
|
||||||
|
}
|
||||||
fg = (COLORREF)csbi.ColorTable[g_color_index_fg];
|
fg = (COLORREF)csbi.ColorTable[g_color_index_fg];
|
||||||
fg = (GetRValue(fg) << 16) | (GetGValue(fg) << 8) | GetBValue(fg);
|
fg = (GetRValue(fg) << 16) | (GetGValue(fg) << 8) | GetBValue(fg);
|
||||||
default_console_color_fg = fg;
|
default_console_color_fg = fg;
|
||||||
@ -8160,11 +8168,20 @@ get_default_console_color(
|
|||||||
ctermbg = -1;
|
ctermbg = -1;
|
||||||
if (id > 0)
|
if (id > 0)
|
||||||
syn_id2cterm_bg(id, &ctermfg, &ctermbg);
|
syn_id2cterm_bg(id, &ctermfg, &ctermbg);
|
||||||
cterm_normal_bg_gui_color = guibg =
|
if (!USE_WT)
|
||||||
|
{
|
||||||
|
guibg = ctermbg != -1 ? ctermtoxterm(ctermbg)
|
||||||
|
: default_console_color_bg;
|
||||||
|
cterm_normal_bg_gui_color = guibg;
|
||||||
|
ctermbg = ctermbg < 0 ? 0 : ctermbg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cterm_normal_bg_gui_color = guibg =
|
||||||
ctermbg != -1 ? ctermtoxterm(ctermbg) : INVALCOLOR;
|
ctermbg != -1 ? ctermtoxterm(ctermbg) : INVALCOLOR;
|
||||||
|
if (ctermbg < 0)
|
||||||
if (ctermbg < 0)
|
ctermbg = 0;
|
||||||
ctermbg = 0;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*cterm_fg = ctermfg;
|
*cterm_fg = ctermfg;
|
||||||
|
@ -707,6 +707,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 */
|
||||||
|
/**/
|
||||||
|
344,
|
||||||
/**/
|
/**/
|
||||||
343,
|
343,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user