Skip to content

Commit 8e8dc9b

Browse files
committed
patch 8.2.4916: mouse in Insert mode test fails
Problem: Mouse in Insert mode test fails. Solution: Fix the text and check relevant positions.
1 parent a91cb98 commit 8e8dc9b

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/testdir/test_edit.vim

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,20 +1213,28 @@ func Test_edit_MOUSE()
12131213
10new
12141214
call setline(1, range(1, 100))
12151215
call cursor(1, 1)
1216+
call assert_equal(1, line('w0'))
1217+
call assert_equal(10, line('w$'))
12161218
set mouse=a
1219+
" One scroll event moves three lines.
12171220
call feedkeys("A\<ScrollWheelDown>\<esc>", 'tnix')
1218-
call assert_equal([0, 4, 1, 0], getpos('.'))
1219-
" This should move by one pageDown, but only moves
1220-
" by one line when the test is run...
1221+
call assert_equal(4, line('w0'))
1222+
call assert_equal(13, line('w$'))
1223+
" This should move by one page down.
12211224
call feedkeys("A\<S-ScrollWheelDown>\<esc>", 'tnix')
1222-
call assert_equal([0, 5, 1, 0], getpos('.'))
1225+
call assert_equal(14, line('w0'))
12231226
set nostartofline
1227+
" Another page down.
12241228
call feedkeys("A\<C-ScrollWheelDown>\<esc>", 'tnix')
1225-
call assert_equal([0, 6, 1, 0], getpos('.'))
1229+
call assert_equal(24, line('w0'))
1230+
1231+
call assert_equal([0, 24, 2, 0], getpos('.'))
1232+
call test_setmouse(4, 3)
12261233
call feedkeys("A\<LeftMouse>\<esc>", 'tnix')
1227-
call assert_equal([0, 6, 1, 0], getpos('.'))
1228-
call feedkeys("A\<RightMouse>\<esc>", 'tnix')
1229-
call assert_equal([0, 6, 1, 0], getpos('.'))
1234+
call assert_equal([0, 27, 2, 0], getpos('.'))
1235+
call test_setmouse(5, 3)
1236+
call feedkeys("A\<RightMouse>\<esc>\<esc>", 'tnix')
1237+
call assert_equal([0, 28, 2, 0], getpos('.'))
12301238
call cursor(1, 100)
12311239
norm! zt
12321240
" this should move by a screen up, but when the test

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ static char *(features[]) =
746746

747747
static int included_patches[] =
748748
{ /* Add new patch number below this line */
749+
/**/
750+
4916,
749751
/**/
750752
4915,
751753
/**/

0 commit comments

Comments
 (0)