summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r--src/testdir/test_functions.vim69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index f0d7385825..fd82801e65 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -3697,6 +3697,73 @@ func Test_getmousepos()
\ column: 8,
\ coladd: 21,
\ }, getmousepos())
+
+ 30vnew
+ setlocal smoothscroll number
+ call setline(1, join(range(100)))
+ exe "normal! \<C-E>"
+ call test_setmouse(1, 5)
+ call assert_equal(#{
+ \ screenrow: 1,
+ \ screencol: 5,
+ \ winid: win_getid(),
+ \ winrow: 1,
+ \ wincol: 5,
+ \ line: 1,
+ \ column: 27,
+ \ coladd: 0,
+ \ }, getmousepos())
+ call test_setmouse(2, 5)
+ call assert_equal(#{
+ \ screenrow: 2,
+ \ screencol: 5,
+ \ winid: win_getid(),
+ \ winrow: 2,
+ \ wincol: 5,
+ \ line: 1,
+ \ column: 53,
+ \ coladd: 0,
+ \ }, getmousepos())
+
+ exe "normal! \<C-E>"
+ call test_setmouse(1, 5)
+ call assert_equal(#{
+ \ screenrow: 1,
+ \ screencol: 5,
+ \ winid: win_getid(),
+ \ winrow: 1,
+ \ wincol: 5,
+ \ line: 1,
+ \ column: 53,
+ \ coladd: 0,
+ \ }, getmousepos())
+ call test_setmouse(2, 5)
+ call assert_equal(#{
+ \ screenrow: 2,
+ \ screencol: 5,
+ \ winid: win_getid(),
+ \ winrow: 2,
+ \ wincol: 5,
+ \ line: 1,
+ \ column: 79,
+ \ coladd: 0,
+ \ }, getmousepos())
+
+ vert resize 4
+ call test_setmouse(2, 2)
+ " This used to crash Vim
+ call assert_equal(#{
+ \ screenrow: 2,
+ \ screencol: 2,
+ \ winid: win_getid(),
+ \ winrow: 2,
+ \ wincol: 2,
+ \ line: 1,
+ \ column: 53,
+ \ coladd: 0,
+ \ }, getmousepos())
+
+ bwipe!
bwipe!
endfunc
@@ -4039,6 +4106,8 @@ func Test_slice()
call assert_equal('', 'ὰ̳β̳́γ̳̂δ̳̃ε̳̄ζ̳̅'->slice(1, -6))
END
call v9.CheckLegacyAndVim9Success(lines)
+
+ call assert_equal(0, slice(v:true, 1))
endfunc
" vim: shiftwidth=2 sts=2 expandtab