diff src/screen.c @ 13851:3edac4cd1c0a v8.0.1797

patch 8.0.1797: terminal window is redrawn too often commit https://github.com/vim/vim/commit/6eddadff13164b98fe8198153cc656897b2cbcb3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 6 16:40:16 2018 +0200 patch 8.0.1797: terminal window is redrawn too often Problem: Terminal window is redrawn too often and scrolling is repeated. Solution: Don't scroll immediately but only when redrawing. Avoid redrawing the whole terminal window on every change.
author Christian Brabandt <cb@256bit.org>
date Sun, 06 May 2018 16:45:05 +0200
parents 0e9b2971d7c3
children 156ebdcb8ef5
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -567,8 +567,12 @@ update_screen(int type_arg)
 	must_redraw = 0;
     }
 
-    /* Need to update w_lines[]. */
-    if (curwin->w_lines_valid == 0 && type < NOT_VALID)
+    /* May need to update w_lines[]. */
+    if (curwin->w_lines_valid == 0 && type < NOT_VALID
+#ifdef FEAT_TERMINAL
+	    && !term_do_update_window(curwin)
+#endif
+		)
 	type = NOT_VALID;
 
     /* Postpone the redrawing when it's not needed and when being called
@@ -1172,10 +1176,10 @@ win_update(win_T *wp)
     }
 
 #ifdef FEAT_TERMINAL
-    /* If this window contains a terminal, redraw works completely differently.
-     */
-    if (term_update_window(wp) == OK)
-    {
+    // If this window contains a terminal, redraw works completely differently.
+    if (term_do_update_window(wp))
+    {
+	term_update_window(wp);
 # ifdef FEAT_MENU
 	/* Draw the window toolbar, if there is one. */
 	if (winbar_height(wp) > 0)