changeset 21042:f5206c704403 v8.2.1072

patch 8.2.1072: missing libvterm test Commit: https://github.com/vim/vim/commit/a0a0c4147fd966e0cd923a2bbfb84b14b15a297e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 27 18:13:10 2020 +0200 patch 8.2.1072: missing libvterm test Problem: Missing libvterm test. Solution: Sync with libvterm revision 768.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Jun 2020 18:15:04 +0200
parents 57c5030aa95c
children 94932e8b7716
files src/libvterm/src/state.c src/libvterm/t/63screen_resize.test src/version.c
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/libvterm/src/state.c
+++ b/src/libvterm/src/state.c
@@ -1844,14 +1844,14 @@ static int on_resize(int rows, int cols,
     state->pos.col++;
   }
 
-  if(state->pos.row >= rows)
-    state->pos.row = rows - 1;
   if(state->pos.row < 0)
     state->pos.row = 0;
+  if(state->pos.row >= rows)
+    state->pos.row = rows - 1;
+  if(state->pos.col < 0)
+    state->pos.col = 0;
   if(state->pos.col >= cols)
     state->pos.col = cols - 1;
-  if(state->pos.col < 0)
-    state->pos.col = 0;
 
   updatecursor(state, &oldpos, 1);
 
--- a/src/libvterm/t/63screen_resize.test
+++ b/src/libvterm/t/63screen_resize.test
@@ -69,6 +69,22 @@ RESIZE 24,80
   ?screen_chars 22,0,23,10 = "Line 25"
   ?cursor = 23,0
 
+!Resize shorter does not send the cursor to a negative row
+# See also https://github.com/vim/vim/pull/6141
+RESET
+WANTSCREEN -b
+RESIZE 25,80
+WANTSCREEN b
+PUSH "\e[24HLine 24\r\nLine 25\e[H"
+  ?cursor = 0,0
+RESIZE 20,80
+  sb_pushline 80 =
+  sb_pushline 80 =
+  sb_pushline 80 =
+  sb_pushline 80 =
+  sb_pushline 80 =
+  ?cursor = 0,0
+
 !Resize taller attempts to pop scrollback
 RESET
 WANTSCREEN -b
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1072,
+/**/
     1071,
 /**/
     1070,