forked from aniani/vim
patch 9.0.1235: MS-Windows console: not flushing termguicolors
Problem: MS-Windows console: not flushing termguicolors. Solution: Flush termguicolors. (Christopher Plewright, closes #11871)
This commit is contained in:
committed by
Bram Moolenaar
parent
ebfec1c531
commit
dc7179f9a4
@@ -6776,20 +6776,30 @@ visual_bell(void)
|
|||||||
WORD attrFlash = ~g_attrCurrent & 0xff;
|
WORD attrFlash = ~g_attrCurrent & 0xff;
|
||||||
|
|
||||||
DWORD dwDummy;
|
DWORD dwDummy;
|
||||||
LPWORD oldattrs = ALLOC_MULT(WORD, Rows * Columns);
|
LPWORD oldattrs = NULL;
|
||||||
|
|
||||||
|
# ifdef FEAT_TERMGUICOLORS
|
||||||
|
if (!(p_tgc || t_colors >= 256))
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
oldattrs = ALLOC_MULT(WORD, Rows * Columns);
|
||||||
if (oldattrs == NULL)
|
if (oldattrs == NULL)
|
||||||
return;
|
return;
|
||||||
ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
|
ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
|
||||||
coordOrigin, &dwDummy);
|
coordOrigin, &dwDummy);
|
||||||
|
}
|
||||||
|
|
||||||
FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
|
FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
|
||||||
coordOrigin, &dwDummy);
|
coordOrigin, &dwDummy);
|
||||||
|
|
||||||
Sleep(15); // wait for 15 msec
|
Sleep(15); // wait for 15 msec
|
||||||
if (!vtp_working)
|
|
||||||
|
if (oldattrs != NULL)
|
||||||
|
{
|
||||||
WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
|
WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
|
||||||
coordOrigin, &dwDummy);
|
coordOrigin, &dwDummy);
|
||||||
vim_free(oldattrs);
|
vim_free(oldattrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -8665,12 +8675,6 @@ wt_init(void)
|
|||||||
wt_working = mch_getenv("WT_SESSION") != NULL;
|
wt_working = mch_getenv("WT_SESSION") != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
use_wt(void)
|
|
||||||
{
|
|
||||||
return USE_WT;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ifdef FEAT_TERMGUICOLORS
|
# ifdef FEAT_TERMGUICOLORS
|
||||||
static int
|
static int
|
||||||
ctermtoxterm(
|
ctermtoxterm(
|
||||||
|
@@ -73,7 +73,6 @@ void set_alist_count(void);
|
|||||||
void fix_arg_enc(void);
|
void fix_arg_enc(void);
|
||||||
int mch_setenv(char *var, char *value, int x);
|
int mch_setenv(char *var, char *value, int x);
|
||||||
int vtp_printf(char *format, ...);
|
int vtp_printf(char *format, ...);
|
||||||
int use_wt(void);
|
|
||||||
void get_default_console_color(int *cterm_fg, int *cterm_bg, guicolor_T *gui_fg, guicolor_T *gui_bg);
|
void get_default_console_color(int *cterm_fg, int *cterm_bg, guicolor_T *gui_fg, guicolor_T *gui_bg);
|
||||||
void control_console_color_rgb(void);
|
void control_console_color_rgb(void);
|
||||||
int use_vtp(void);
|
int use_vtp(void);
|
||||||
|
@@ -3222,7 +3222,7 @@ term_rgb_color(char_u *s, guicolor_T rgb)
|
|||||||
vim_snprintf(buf, MAX_COLOR_STR_LEN,
|
vim_snprintf(buf, MAX_COLOR_STR_LEN,
|
||||||
(char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
|
(char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
|
||||||
#ifdef FEAT_VTP
|
#ifdef FEAT_VTP
|
||||||
if (use_wt())
|
if (use_vtp() && (p_tgc || t_colors >= 256))
|
||||||
{
|
{
|
||||||
out_flush();
|
out_flush();
|
||||||
buf[1] = '[';
|
buf[1] = '[';
|
||||||
|
@@ -695,6 +695,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 */
|
||||||
|
/**/
|
||||||
|
1235,
|
||||||
/**/
|
/**/
|
||||||
1234,
|
1234,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user