0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

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 <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
zeertzjq 2023-09-24 23:30:03 +02:00 committed by Christian Brabandt
parent e6fca0e822
commit 46a0582ffa
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 22 additions and 0 deletions

View 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&

View File

@ -699,6 +699,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1937,
/**/
1936,
/**/