diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-03-15 10:25:06 +0000 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-03-15 11:41:13 +0000 |
| commit | 716df377b4bbf1ec64c1115ccc652b5b24797869 (patch) | |
| tree | f7c07956ecba334869147f2447192bcf1c8f8d25 /src/nvim/testdir | |
| parent | 4a8b6bde019ea63a7ad74fbf7defc0156497f2e5 (diff) | |
| download | rneovim-716df377b4bbf1ec64c1115ccc652b5b24797869.tar.gz rneovim-716df377b4bbf1ec64c1115ccc652b5b24797869.tar.bz2 rneovim-716df377b4bbf1ec64c1115ccc652b5b24797869.zip | |
vim-patch:8.2.4568: getmousepos() does not compute the column below the last line
Problem: getmousepos() does not compute the column below the last line.
Solution: Also compute the column when the mouse is below the last line.
(Sean Dewar, closes vim/vim#9946)
https://github.com/vim/vim/commit/10792feebd237aee89270669e509e85cafdfac60
test_setmouse is N/A.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_functions.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index d83606882c..c2b5653a29 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1801,6 +1801,33 @@ func Test_getmousepos() \ line: 1, \ column: 8, \ }, getmousepos()) + + " If the mouse is positioned past the last buffer line, "line" and "column" + " should act like it's positioned on the last buffer line. + " call test_setmouse(2, 25) + call nvim_input_mouse('left', 'press', '', 0, 1, 24) + call getchar() " wait for and consume the mouse press + call assert_equal(#{ + \ screenrow: 2, + \ screencol: 25, + \ winid: win_getid(), + \ winrow: 2, + \ wincol: 25, + \ line: 1, + \ column: 4, + \ }, getmousepos()) + " call test_setmouse(2, 50) + call nvim_input_mouse('left', 'press', '', 0, 1, 49) + call getchar() " wait for and consume the mouse press + call assert_equal(#{ + \ screenrow: 2, + \ screencol: 50, + \ winid: win_getid(), + \ winrow: 2, + \ wincol: 50, + \ line: 1, + \ column: 8, + \ }, getmousepos()) bwipe! endfunc |