]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1937: missing test for mouse click + 'virtedit' v9.0.1937
authorzeertzjq <zeertzjq@outlook.com>
Sun, 24 Sep 2023 21:30:03 +0000 (23:30 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 24 Sep 2023 21:30:03 +0000 (23:30 +0200)
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 <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
src/testdir/test_virtualedit.vim
src/version.c

index 9f254c65a43978f5129b7f0900dd6c9fafc9b836..ec2b276c3f812fce562ceca4b28b553185cbc55d 100644 (file)
@@ -598,6 +598,9 @@ func Test_virtualedit_mouse()
   call test_setmouse(row, 21 + 15)
   call feedkeys("\<LeftMouse>", "xt")
   call assert_equal([0, 1, 10, 2, 15], getcurpos())
+  call test_setmouse(row, 21 + 20)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 10, 7, 20], getcurpos())
 
   setlocal nowrap
   call setline(2, repeat('a', 19))
@@ -654,6 +657,23 @@ func Test_virtualedit_mouse()
     sign undefine Sign1
   endif
 
+  wincmd h
+  4wincmd >
+  normal! gg24I.
+  redraw
+  call test_setmouse(row + 1, 12)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 24 + 9, 0, 24 + 12], getcurpos())
+  call test_setmouse(row + 1, 13)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 24 + 10, 0, 24 + 13], getcurpos())
+  call test_setmouse(row + 1, 15)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 24 + 10, 2, 24 + 15], getcurpos())
+  call test_setmouse(row + 1, 20)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 24 + 10, 7, 24 + 20], getcurpos())
+
   bwipe!
   let &mouse = save_mouse
   set virtualedit&
index 54ab5539d026e83ac125c56e2ff9f86ec9bb55c2..7978aa0bf0fea8b73401ca4c03231a3900930595 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1937,
 /**/
     1936,
 /**/