aboutsummaryrefslogtreecommitdiff
path: root/test/old
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-21 12:05:08 +0800
committerGitHub <noreply@github.com>2023-09-21 12:05:08 +0800
commit0aea8fad48ccd891022a5595fc7cdedbe4c04ad3 (patch)
treef4273000589b33ed5b98990e22d766f904428de4 /test/old
parentf094db0e5ccaddca2b5db05bf9545d55f3eededf (diff)
parente25cf47ad3e10e0e1ae2b2376d898382af5b1e26 (diff)
downloadrneovim-0aea8fad48ccd891022a5595fc7cdedbe4c04ad3.tar.gz
rneovim-0aea8fad48ccd891022a5595fc7cdedbe4c04ad3.tar.bz2
rneovim-0aea8fad48ccd891022a5595fc7cdedbe4c04ad3.zip
Merge pull request #25281 from zeertzjq/vim-9.0.1919
vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplits
Diffstat (limited to 'test/old')
-rw-r--r--test/old/testdir/test_normal.vim33
-rw-r--r--test/old/testdir/test_virtualedit.vim23
2 files changed, 46 insertions, 10 deletions
diff --git a/test/old/testdir/test_normal.vim b/test/old/testdir/test_normal.vim
index 3c21041899..09d3f0432f 100644
--- a/test/old/testdir/test_normal.vim
+++ b/test/old/testdir/test_normal.vim
@@ -4107,6 +4107,39 @@ func Test_normal_click_on_double_width_char()
let &mouse = save_mouse
endfunc
+func Test_normal_click_on_empty_line()
+ let save_mouse = &mouse
+ set mouse=a
+ botright new
+ call setline(1, ['', '', ''])
+ let row = win_screenpos(0)[0] + 2
+ 20vsplit
+ redraw
+
+ call Ntest_setmouse(row, 1)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 1], getcurpos())
+ call Ntest_setmouse(row, 2)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 2], getcurpos())
+ call Ntest_setmouse(row, 10)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 10], getcurpos())
+
+ call Ntest_setmouse(row, 21 + 1)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 1], getcurpos())
+ call Ntest_setmouse(row, 21 + 2)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 2], getcurpos())
+ call Ntest_setmouse(row, 21 + 10)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call assert_equal([0, 3, 1, 0, 10], getcurpos())
+
+ bwipe!
+ let &mouse = save_mouse
+endfunc
+
func Test_normal33_g_cmd_nonblank()
" Test that g<End> goes to the last non-blank char and g$ to the last
" visible column
diff --git a/test/old/testdir/test_virtualedit.vim b/test/old/testdir/test_virtualedit.vim
index 6ff51e36fb..4c11fcd99e 100644
--- a/test/old/testdir/test_virtualedit.vim
+++ b/test/old/testdir/test_virtualedit.vim
@@ -564,35 +564,38 @@ func Test_virtualedit_mouse()
let save_mouse = &mouse
set mouse=a
set virtualedit=all
- new
+ botright new
+ let row = win_screenpos(0)[0]
+ 20vsplit
+ wincmd p
call setline(1, ["text\tword"])
redraw
- call Ntest_setmouse(1, 4)
+ call Ntest_setmouse(row, 21 + 4)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 4, 0, 4], getcurpos())
- call Ntest_setmouse(1, 5)
+ call Ntest_setmouse(row, 21 + 5)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 5, 0, 5], getcurpos())
- call Ntest_setmouse(1, 6)
+ call Ntest_setmouse(row, 21 + 6)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 5, 1, 6], getcurpos())
- call Ntest_setmouse(1, 7)
+ call Ntest_setmouse(row, 21 + 7)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 5, 2, 7], getcurpos())
- call Ntest_setmouse(1, 8)
+ call Ntest_setmouse(row, 21 + 8)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 5, 3, 8], getcurpos())
- call Ntest_setmouse(1, 9)
+ call Ntest_setmouse(row, 21 + 9)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 6, 0, 9], getcurpos())
- call Ntest_setmouse(1, 12)
+ call Ntest_setmouse(row, 21 + 12)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 9, 0, 12], getcurpos())
- call Ntest_setmouse(1, 13)
+ call Ntest_setmouse(row, 21 + 13)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 10, 0, 13], getcurpos())
- call Ntest_setmouse(1, 15)
+ call Ntest_setmouse(row, 21 + 15)
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 10, 2, 15], getcurpos())