changeset 12116:237bb67962a0 v8.0.0938

patch 8.0.0938: scrolling in terminal window is inefficient commit https://github.com/vim/vim/commit/6bb18a878cc4cc79cdca4b7497367e59a90125e7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 13 22:14:17 2017 +0200 patch 8.0.0938: scrolling in terminal window is inefficient Problem: Scrolling in terminal window is inefficient. Solution: Use win_del_lines().
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2017 22:15:04 +0200
parents 36ceab3a7cdc
children b8426b79c762
files src/terminal.c src/version.c
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -38,11 +38,6 @@
  * in tl_scrollback are no longer used.
  *
  * TODO:
- * - add a character in :ls output
- * - add 't' to mode()
- * - use win_del_lines() to make scroll-up efficient.
- * - Make StatusLineTerm adjust UserN highlighting like StatusLineNC does, see
- *   use of hightlight_stlnc[].
  * - implement term_setsize()
  * - add test for giving error for invalid 'termsize' value.
  * - support minimal size when 'termsize' is "rows*cols".
@@ -1495,11 +1490,21 @@ handle_damage(VTermRect rect, void *user
 }
 
     static int
-handle_moverect(VTermRect dest UNUSED, VTermRect src UNUSED, void *user)
+handle_moverect(VTermRect dest, VTermRect src, void *user)
 {
     term_T	*term = (term_T *)user;
-
-    /* TODO */
+    win_T	*wp;
+
+    if (dest.start_col == src.start_col
+	    && dest.end_col == src.end_col
+	    && dest.start_row < src.start_row)
+	FOR_ALL_WINDOWS(wp)
+	{
+	    if (wp->w_buffer == term->tl_buffer)
+		/* scrolling up is much more efficient when deleting lines */
+		win_del_lines(wp, dest.start_row,
+				 src.start_row - dest.start_row, FALSE, FALSE);
+	}
     redraw_buf_later(term->tl_buffer, NOT_VALID);
     return 1;
 }
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    938,
+/**/
     937,
 /**/
     936,