]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0316: screen flickers when 'cmdheight' is zero v9.0.0316
authorBram Moolenaar <Bram@vim.org>
Mon, 29 Aug 2022 11:41:06 +0000 (12:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 29 Aug 2022 11:41:06 +0000 (12:41 +0100)
Problem:    Screen flickers when 'cmdheight' is zero.
Solution:   Redraw over existing text instead of clearing.

src/drawscreen.c
src/ex_getln.c
src/version.c

index ecbdd9f0f2bab83813a546ebdad622133086031f..529792f06cff0edd579a57a6346e424003ecbb0e 100644 (file)
@@ -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)
-                                                                      == FAIL)
-               type = UPD_CLEAR;
-           FOR_ALL_WINDOWS(wp)
+           if (msg_scrolled > Rows - 5)            // redrawing is faster
+               type = UPD_NOT_VALID;
+           else
            {
-               if (wp->w_winrow < msg_scrolled)
+               check_for_delay(FALSE);
+               if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
+                                                                      == FAIL)
+                   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)
-                   {
-                       wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
-                       wp->w_redr_type = UPD_REDRAW_TOP;
-                   }
-                   else
+                   if (wp->w_winrow < msg_scrolled)
                    {
-                       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;
index 58dc1524ec42014dace6c2990fc616df8e9f4840..f28ce8a6c520041649ff6c0738beae53fdc1faf2 100644 (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;
        }
 
index 82b43beee1768f61e3293b2476868e5969397666..4dbe10080fb7d82dd9a7a1844114d230c36593d1 100644 (file)
@@ -707,6 +707,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    316,
 /**/
     315,
 /**/