Skip to content

Commit 46a0582

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.0.1937: missing test for mouse click + 'virtedit'
Problem: missing test for mouse click + 'virtedit' Solution: Add test for clicking after eol with 'virtualedit' and wrapped line closes: #13157 Signed-off-by: Christian Brabandt <[email protected]> Co-authored-by: zeertzjq <[email protected]>
1 parent e6fca0e commit 46a0582

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/testdir/test_virtualedit.vim

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ func Test_virtualedit_mouse()
598598
call test_setmouse(row, 21 + 15)
599599
call feedkeys("\<LeftMouse>", "xt")
600600
call assert_equal([0, 1, 10, 2, 15], getcurpos())
601+
call test_setmouse(row, 21 + 20)
602+
call feedkeys("\<LeftMouse>", "xt")
603+
call assert_equal([0, 1, 10, 7, 20], getcurpos())
601604

602605
setlocal nowrap
603606
call setline(2, repeat('a', 19))
@@ -654,6 +657,23 @@ func Test_virtualedit_mouse()
654657
sign undefine Sign1
655658
endif
656659

660+
wincmd h
661+
4wincmd >
662+
normal! gg24I.
663+
redraw
664+
call test_setmouse(row + 1, 12)
665+
call feedkeys("\<LeftMouse>", "xt")
666+
call assert_equal([0, 1, 24 + 9, 0, 24 + 12], getcurpos())
667+
call test_setmouse(row + 1, 13)
668+
call feedkeys("\<LeftMouse>", "xt")
669+
call assert_equal([0, 1, 24 + 10, 0, 24 + 13], getcurpos())
670+
call test_setmouse(row + 1, 15)
671+
call feedkeys("\<LeftMouse>", "xt")
672+
call assert_equal([0, 1, 24 + 10, 2, 24 + 15], getcurpos())
673+
call test_setmouse(row + 1, 20)
674+
call feedkeys("\<LeftMouse>", "xt")
675+
call assert_equal([0, 1, 24 + 10, 7, 24 + 20], getcurpos())
676+
657677
bwipe!
658678
let &mouse = save_mouse
659679
set virtualedit&

src/version.c

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

700700
static int included_patches[] =
701701
{ /* Add new patch number below this line */
702+
/**/
703+
1937,
702704
/**/
703705
1936,
704706
/**/

0 commit comments

Comments
 (0)