summaryrefslogtreecommitdiffstats
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorChristopher Plewright <chris@createng.com>2023-01-23 12:33:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-23 12:33:23 +0000
commitdc7179f9a4cc74d864d1f6414e691d25bac8f831 (patch)
tree4ae1b75eed477cbdad0f92cb241c6c12b52f689b /src/os_win32.c
parentebfec1c531f32d424bb2aca6e7391ef3bfcbfe20 (diff)
patch 9.0.1235: MS-Windows console: not flushing termguicolorsv9.0.1235
Problem: MS-Windows console: not flushing termguicolors. Solution: Flush termguicolors. (Christopher Plewright, closes #11871)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index ba5d228b84..e80533b017 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -6776,20 +6776,30 @@ visual_bell(void)
WORD attrFlash = ~g_attrCurrent & 0xff;
DWORD dwDummy;
- LPWORD oldattrs = ALLOC_MULT(WORD, Rows * Columns);
+ LPWORD oldattrs = NULL;
- if (oldattrs == NULL)
- return;
- ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
+# ifdef FEAT_TERMGUICOLORS
+ if (!(p_tgc || t_colors >= 256))
+# endif
+ {
+ oldattrs = ALLOC_MULT(WORD, Rows * Columns);
+ if (oldattrs == NULL)
+ return;
+ ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
coordOrigin, &dwDummy);
+ }
+
FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
coordOrigin, &dwDummy);
Sleep(15); // wait for 15 msec
- if (!vtp_working)
+
+ if (oldattrs != NULL)
+ {
WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
coordOrigin, &dwDummy);
- vim_free(oldattrs);
+ vim_free(oldattrs);
+ }
}
@@ -8665,12 +8675,6 @@ wt_init(void)
wt_working = mch_getenv("WT_SESSION") != NULL;
}
- int
-use_wt(void)
-{
- return USE_WT;
-}
-
# ifdef FEAT_TERMGUICOLORS
static int
ctermtoxterm(