0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

patch 9.0.0316: screen flickers when 'cmdheight' is zero

Problem:    Screen flickers when 'cmdheight' is zero.
Solution:   Redraw over existing text instead of clearing.
This commit is contained in:
Bram Moolenaar 2022-08-29 12:41:06 +01:00
parent 309c4e0ed7
commit f73e5ba56f
3 changed files with 31 additions and 26 deletions

View File

@ -170,14 +170,16 @@ update_screen(int type_arg)
if (msg_scrolled)
{
clear_cmdline = TRUE;
if (msg_scrolled > Rows - 5) // clearing is faster
type = UPD_CLEAR;
else if (type != UPD_CLEAR)
if (type != UPD_CLEAR)
{
if (msg_scrolled > Rows - 5) // redrawing is faster
type = UPD_NOT_VALID;
else
{
check_for_delay(FALSE);
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
== FAIL)
type = UPD_CLEAR;
type = UPD_NOT_VALID;
FOR_ALL_WINDOWS(wp)
{
if (wp->w_winrow < msg_scrolled)
@ -193,8 +195,8 @@ update_screen(int type_arg)
else
{
wp->w_redr_type = UPD_NOT_VALID;
if (W_WINROW(wp) + wp->w_height + wp->w_status_height
<= msg_scrolled)
if (W_WINROW(wp) + wp->w_height
+ wp->w_status_height <= msg_scrolled)
wp->w_redr_status = TRUE;
}
}
@ -203,6 +205,7 @@ update_screen(int type_arg)
redraw_cmdline = TRUE;
redraw_tabline = TRUE;
}
}
msg_scrolled = 0;
need_wait_return = FALSE;
}

View File

@ -2582,7 +2582,7 @@ theend:
made_cmdheight_nonzero = TRUE;
set_option_value((char_u *)"ch", 0L, NULL, 0);
// Redraw is needed for command line completion
redraw_all_later(UPD_CLEAR);
redraw_all_later(UPD_NOT_VALID);
made_cmdheight_nonzero = FALSE;
}

View File

@ -707,6 +707,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
316,
/**/
315,
/**/