diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-10-15 17:19:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-15 17:19:01 +0800 |
commit | d974a3dcbb3757ebeb78fa64054c795ab7acdf1a (patch) | |
tree | d505cf88bb6f17fc3dcf33f96f811174b5b51d7e /test/old/testdir/test_functions.vim | |
parent | a350fb2976d9b1e8b5753f557645a905f6da0d74 (diff) | |
download | rneovim-d974a3dcbb3757ebeb78fa64054c795ab7acdf1a.tar.gz rneovim-d974a3dcbb3757ebeb78fa64054c795ab7acdf1a.tar.bz2 rneovim-d974a3dcbb3757ebeb78fa64054c795ab7acdf1a.zip |
vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)
Problem: Cannot accurately get mouse clicking position when clicking on
a TAB or with virtual text.
Solution: Add a "coladd" field to getmousepos() result.
closes: vim/vim#13335
https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
Diffstat (limited to 'test/old/testdir/test_functions.vim')
-rw-r--r-- | test/old/testdir/test_functions.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 6a4d80d94d..9448ff21aa 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -3068,6 +3068,7 @@ func Test_getmousepos() \ wincol: 1, \ line: 1, \ column: 1, + \ coladd: 0, \ }, getmousepos()) call Ntest_setmouse(1, 2) call assert_equal(#{ @@ -3078,6 +3079,7 @@ func Test_getmousepos() \ wincol: 2, \ line: 1, \ column: 1, + \ coladd: 1, \ }, getmousepos()) call Ntest_setmouse(1, 8) call assert_equal(#{ @@ -3088,6 +3090,7 @@ func Test_getmousepos() \ wincol: 8, \ line: 1, \ column: 1, + \ coladd: 7, \ }, getmousepos()) call Ntest_setmouse(1, 9) call assert_equal(#{ @@ -3098,6 +3101,7 @@ func Test_getmousepos() \ wincol: 9, \ line: 1, \ column: 2, + \ coladd: 0, \ }, getmousepos()) call Ntest_setmouse(1, 12) call assert_equal(#{ @@ -3108,6 +3112,7 @@ func Test_getmousepos() \ wincol: 12, \ line: 1, \ column: 2, + \ coladd: 3, \ }, getmousepos()) call Ntest_setmouse(1, 25) call assert_equal(#{ @@ -3118,6 +3123,29 @@ func Test_getmousepos() \ wincol: 25, \ line: 1, \ column: 4, + \ coladd: 0, + \ }, getmousepos()) + call Ntest_setmouse(1, 28) + call assert_equal(#{ + \ screenrow: 1, + \ screencol: 28, + \ winid: win_getid(), + \ winrow: 1, + \ wincol: 28, + \ line: 1, + \ column: 7, + \ coladd: 0, + \ }, getmousepos()) + call Ntest_setmouse(1, 29) + call assert_equal(#{ + \ screenrow: 1, + \ screencol: 29, + \ winid: win_getid(), + \ winrow: 1, + \ wincol: 29, + \ line: 1, + \ column: 8, + \ coladd: 0, \ }, getmousepos()) call Ntest_setmouse(1, 50) call assert_equal(#{ @@ -3128,6 +3156,7 @@ func Test_getmousepos() \ wincol: 50, \ line: 1, \ column: 8, + \ coladd: 21, \ }, getmousepos()) " If the mouse is positioned past the last buffer line, "line" and "column" @@ -3141,6 +3170,7 @@ func Test_getmousepos() \ wincol: 25, \ line: 1, \ column: 4, + \ coladd: 0, \ }, getmousepos()) call Ntest_setmouse(2, 50) call assert_equal(#{ @@ -3151,6 +3181,7 @@ func Test_getmousepos() \ wincol: 50, \ line: 1, \ column: 8, + \ coladd: 21, \ }, getmousepos()) bwipe! endfunc |