diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-21 08:00:03 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-09-21 09:43:12 +0800 |
commit | adb73772d9197a7fa6e9ee7a2e8874118e60844d (patch) | |
tree | c5c2087188b5627c2fe1f31f37e068b644c481e2 /test/old/testdir/test_normal.vim | |
parent | f094db0e5ccaddca2b5db05bf9545d55f3eededf (diff) | |
download | rneovim-adb73772d9197a7fa6e9ee7a2e8874118e60844d.tar.gz rneovim-adb73772d9197a7fa6e9ee7a2e8874118e60844d.tar.bz2 rneovim-adb73772d9197a7fa6e9ee7a2e8874118e60844d.zip |
vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplits
Problem: Wrong curswant when clicking on empty line or with vsplits.
Solution: Don't check for ScreenCols[] before the start of the window
and handle empty line properly.
closes: vim/vim#13132
https://github.com/vim/vim/commit/03cd697d635f1b0e7ffe21cf8244a8fb755f2ddb
Diffstat (limited to 'test/old/testdir/test_normal.vim')
-rw-r--r-- | test/old/testdir/test_normal.vim | 33 |
1 files changed, 33 insertions, 0 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 |