changeset 15380:f62d6bd18a49 v8.1.0698

patch 8.1.0698: clearing the window is used too often commit https://github.com/vim/vim/commit/bf3250a8ad39797e3ccdac82d20c6f19533419e4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 6 17:25:29 2019 +0100 patch 8.1.0698: clearing the window is used too often Problem: Clearing the window is used too often, causing the command line to be cleared when opening a tab. (Miroslav Ko?k?r) Solution: Use NOT_VALID instead of CLEAR. (suggested by Jason Franklin, closes #630) Also do this for a few other places where clearing the screen isn't really needed.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jan 2019 17:30:05 +0100
parents 8a81844b9925
children 751ca7c44de4
files src/version.c src/window.c
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -800,6 +800,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    698,
+/**/
     697,
 /**/
     696,
--- a/src/window.c
+++ b/src/window.c
@@ -1577,7 +1577,7 @@ win_exchange(long Prenum)
     (void)win_comp_pos();		/* recompute window positions */
 
     win_enter(wp, TRUE);
-    redraw_later(CLEAR);
+    redraw_all_later(NOT_VALID);
 }
 
 /*
@@ -1660,7 +1660,7 @@ win_rotate(int upwards, int count)
 	(void)win_comp_pos();
     }
 
-    redraw_later(CLEAR);
+    redraw_all_later(NOT_VALID);
 }
 
 /*
@@ -1817,7 +1817,7 @@ win_equal_rec(
 	    frame_new_height(topfr, height, FALSE, FALSE);
 	    topfr->fr_win->w_wincol = col;
 	    frame_new_width(topfr, width, FALSE, FALSE);
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(NOT_VALID);
 	}
     }
     else if (topfr->fr_layout == FR_ROW)
@@ -3702,7 +3702,7 @@ win_new_tabpage(int after)
 	entering_window(curwin);
 #endif
 
-	redraw_all_later(CLEAR);
+	redraw_all_later(NOT_VALID);
 	apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf);
 	apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf);
 	apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf);
@@ -3939,7 +3939,6 @@ enter_tabpage(
 
     last_status(FALSE);		/* status line may appear or disappear */
     (void)win_comp_pos();	/* recompute w_winrow for all windows */
-    must_redraw = CLEAR;	/* need to redraw everything */
 #ifdef FEAT_DIFF
     diff_need_scrollbind = TRUE;
 #endif
@@ -3973,7 +3972,7 @@ enter_tabpage(
 	    apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
     }
 
-    redraw_all_later(CLEAR);
+    redraw_all_later(NOT_VALID);
 }
 
 /*
@@ -6569,7 +6568,7 @@ restore_snapshot(
 	win_comp_pos();
 	if (wp != NULL && close_curwin)
 	    win_goto(wp);
-	redraw_all_later(CLEAR);
+	redraw_all_later(NOT_VALID);
     }
     clear_snapshot(curtab, idx);
 }