changeset 29956:451ec8a09a63 v9.0.0316

patch 9.0.0316: screen flickers when 'cmdheight' is zero Commit: https://github.com/vim/vim/commit/f73e5ba56f4aca1cd6e38f1c8ea24e941bf6b33f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 29 12:41:06 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Aug 2022 13:45:03 +0200
parents 1251b5181693
children 60901ab49eae
files src/drawscreen.c src/ex_getln.c src/version.c
diffstat 3 files changed, 31 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -170,38 +170,41 @@ 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)
 	{
-	    check_for_delay(FALSE);
-	    if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
+	    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;
-	    FOR_ALL_WINDOWS(wp)
-	    {
-		if (wp->w_winrow < msg_scrolled)
+		    type = UPD_NOT_VALID;
+		FOR_ALL_WINDOWS(wp)
 		{
-		    if (W_WINROW(wp) + wp->w_height > msg_scrolled
-			    && wp->w_redr_type < UPD_REDRAW_TOP
-			    && wp->w_lines_valid > 0
-			    && wp->w_topline == wp->w_lines[0].wl_lnum)
+		    if (wp->w_winrow < msg_scrolled)
 		    {
-			wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
-			wp->w_redr_type = UPD_REDRAW_TOP;
-		    }
-		    else
-		    {
-			wp->w_redr_type = UPD_NOT_VALID;
-			if (W_WINROW(wp) + wp->w_height + wp->w_status_height
-							       <= msg_scrolled)
-			    wp->w_redr_status = TRUE;
+			if (W_WINROW(wp) + wp->w_height > msg_scrolled
+				&& wp->w_redr_type < UPD_REDRAW_TOP
+				&& wp->w_lines_valid > 0
+				&& wp->w_topline == wp->w_lines[0].wl_lnum)
+			{
+			    wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
+			    wp->w_redr_type = UPD_REDRAW_TOP;
+			}
+			else
+			{
+			    wp->w_redr_type = UPD_NOT_VALID;
+			    if (W_WINROW(wp) + wp->w_height
+					 + wp->w_status_height <= msg_scrolled)
+				wp->w_redr_status = TRUE;
+			}
 		    }
 		}
+		if (!no_update)
+		    redraw_cmdline = TRUE;
+		redraw_tabline = TRUE;
 	    }
-	    if (!no_update)
-		redraw_cmdline = TRUE;
-	    redraw_tabline = TRUE;
 	}
 	msg_scrolled = 0;
 	need_wait_return = FALSE;
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -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;
 	}
 
--- a/src/version.c
+++ b/src/version.c
@@ -708,6 +708,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    316,
+/**/
     315,
 /**/
     314,