]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4916: mouse in Insert mode test fails v8.2.4916
authorBram Moolenaar <Bram@vim.org>
Sun, 8 May 2022 19:38:06 +0000 (20:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 May 2022 19:38:06 +0000 (20:38 +0100)
Problem:    Mouse in Insert mode test fails.
Solution:   Fix the text and check relevant positions.

src/testdir/test_edit.vim
src/version.c

index dddffa389167c2daea750481466a9e0a2288cd68..8c4d9f2223413d9b2cad3a006f55994f589e550c 100644 (file)
@@ -1213,20 +1213,28 @@ func Test_edit_MOUSE()
   10new
   call setline(1, range(1, 100))
   call cursor(1, 1)
+  call assert_equal(1, line('w0'))
+  call assert_equal(10, line('w$'))
   set mouse=a
+  " One scroll event moves three lines.
   call feedkeys("A\<ScrollWheelDown>\<esc>", 'tnix')
-  call assert_equal([0, 4, 1, 0], getpos('.'))
-  " This should move by one pageDown, but only moves
-  " by one line when the test is run...
+  call assert_equal(4, line('w0'))
+  call assert_equal(13, line('w$'))
+  " This should move by one page down.
   call feedkeys("A\<S-ScrollWheelDown>\<esc>", 'tnix')
-  call assert_equal([0, 5, 1, 0], getpos('.'))
+  call assert_equal(14, line('w0'))
   set nostartofline
+  " Another page down.
   call feedkeys("A\<C-ScrollWheelDown>\<esc>", 'tnix')
-  call assert_equal([0, 6, 1, 0], getpos('.'))
+  call assert_equal(24, line('w0'))
+
+  call assert_equal([0, 24, 2, 0], getpos('.'))
+  call test_setmouse(4, 3)
   call feedkeys("A\<LeftMouse>\<esc>", 'tnix')
-  call assert_equal([0, 6, 1, 0], getpos('.'))
-  call feedkeys("A\<RightMouse>\<esc>", 'tnix')
-  call assert_equal([0, 6, 1, 0], getpos('.'))
+  call assert_equal([0, 27, 2, 0], getpos('.'))
+  call test_setmouse(5, 3)
+  call feedkeys("A\<RightMouse>\<esc>\<esc>", 'tnix')
+  call assert_equal([0, 28, 2, 0], getpos('.'))
   call cursor(1, 100)
   norm! zt
   " this should move by a screen up, but when the test
index 0fda34805ec777f8b2b1d791db43b58033638768..4e7a3356455a7ff2343775e68c80d79e22d053f0 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4916,
 /**/
     4915,
 /**/