mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.2.0669: MS-Windows: display in VTP is a bit slow
Problem: MS-Windows: display in VTP is a bit slow. Solution: Optimize the code. (Nobuhiro Takasaki, closes #6014)
This commit is contained in:
29
src/screen.c
29
src/screen.c
@@ -1880,6 +1880,9 @@ screen_start_highlight(int attr)
|
||||
screen_stop_highlight(void)
|
||||
{
|
||||
int do_ME = FALSE; // output T_ME code
|
||||
#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS)
|
||||
int do_ME_fg, do_ME_bg;
|
||||
#endif
|
||||
|
||||
if (screen_attr != 0
|
||||
#ifdef MSWIN
|
||||
@@ -1913,16 +1916,42 @@ screen_stop_highlight(void)
|
||||
#ifdef FEAT_TERMGUICOLORS
|
||||
p_tgc && aep->ae_u.cterm.fg_rgb != CTERMCOLOR
|
||||
? aep->ae_u.cterm.fg_rgb != INVALCOLOR
|
||||
# ifdef FEAT_VTP
|
||||
? !(do_ME_fg = TRUE) : (do_ME_fg = FALSE)
|
||||
# endif
|
||||
:
|
||||
#endif
|
||||
aep->ae_u.cterm.fg_color) || (
|
||||
#ifdef FEAT_TERMGUICOLORS
|
||||
p_tgc && aep->ae_u.cterm.bg_rgb != CTERMCOLOR
|
||||
? aep->ae_u.cterm.bg_rgb != INVALCOLOR
|
||||
# ifdef FEAT_VTP
|
||||
? !(do_ME_bg = TRUE) : (do_ME_bg = FALSE)
|
||||
# endif
|
||||
:
|
||||
#endif
|
||||
aep->ae_u.cterm.bg_color)))
|
||||
do_ME = TRUE;
|
||||
#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS)
|
||||
if (use_vtp())
|
||||
{
|
||||
if (do_ME_fg && do_ME_bg)
|
||||
do_ME = TRUE;
|
||||
|
||||
// FG and BG cannot be separated in T_ME, which is not
|
||||
// efficient.
|
||||
if (!do_ME && do_ME_fg)
|
||||
out_str((char_u *)"\033|39m"); // restore FG
|
||||
if (!do_ME && do_ME_bg)
|
||||
out_str((char_u *)"\033|49m"); // restore BG
|
||||
}
|
||||
else
|
||||
{
|
||||
// Process FG and BG at once.
|
||||
if (!do_ME)
|
||||
do_ME = do_ME_fg | do_ME_bg;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user