summaryrefslogtreecommitdiff
path: root/src/libvterm
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-27 18:13:10 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-27 18:13:10 +0200
commita0a0c4147fd966e0cd923a2bbfb84b14b15a297e (patch)
tree5f1de4d5cc25fd7d99bc7ef39698912824327376 /src/libvterm
parente40fbc2ca9fda07332a4da5af1fcaba91bed865b (diff)
downloadvim-git-a0a0c4147fd966e0cd923a2bbfb84b14b15a297e.tar.gz
patch 8.2.1072: missing libvterm testv8.2.1072
Problem: Missing libvterm test. Solution: Sync with libvterm revision 768.
Diffstat (limited to 'src/libvterm')
-rw-r--r--src/libvterm/src/state.c8
-rw-r--r--src/libvterm/t/63screen_resize.test16
2 files changed, 20 insertions, 4 deletions
diff --git a/src/libvterm/src/state.c b/src/libvterm/src/state.c
index 30438efe8..4fe3d7d20 100644
--- a/src/libvterm/src/state.c
+++ b/src/libvterm/src/state.c
@@ -1844,14 +1844,14 @@ static int on_resize(int rows, int cols, void *user)
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.col >= cols)
- state->pos.col = cols - 1;
+ 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;
updatecursor(state, &oldpos, 1);
diff --git a/src/libvterm/t/63screen_resize.test b/src/libvterm/t/63screen_resize.test
index 87932f66d..87b88d64e 100644
--- 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