comparison src/testdir/test_functions.vim @ 28069:236b80af9833 v8.2.4559

patch 8.2.4559: getmousepos() returns the screen column Commit: https://github.com/vim/vim/commit/533870a98501fac2b51ef4bc489fac3a055a41a9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 13 15:52:44 2022 +0000 patch 8.2.4559: getmousepos() returns the screen column Problem: getmousepos() returns the screen column. (Ernie Rael) Solution: Return the text column, as documented.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Mar 2022 17:00:03 +0100
parents 050d49de7a66
children 4c60e656e054
comparison
equal deleted inserted replaced
28068:1be25e090d52 28069:236b80af9833
2751 endfunc 2751 endfunc
2752 2752
2753 func Test_getmousepos() 2753 func Test_getmousepos()
2754 enew! 2754 enew!
2755 call setline(1, "\t\t\t1234") 2755 call setline(1, "\t\t\t1234")
2756 call test_setmouse(1, 1)
2757 call assert_equal(#{
2758 \ screenrow: 1,
2759 \ screencol: 1,
2760 \ winid: win_getid(),
2761 \ winrow: 1,
2762 \ wincol: 1,
2763 \ line: 1,
2764 \ column: 1,
2765 \ }, getmousepos())
2756 call test_setmouse(1, 25) 2766 call test_setmouse(1, 25)
2757 call assert_equal(#{ 2767 call assert_equal(#{
2758 \ screenrow: 1, 2768 \ screenrow: 1,
2759 \ screencol: 25, 2769 \ screencol: 25,
2760 \ winid: win_getid(), 2770 \ winid: win_getid(),
2761 \ winrow: 1, 2771 \ winrow: 1,
2762 \ wincol: 25, 2772 \ wincol: 25,
2763 \ line: 1, 2773 \ line: 1,
2764 \ column: 25, 2774 \ column: 4,
2765 \ }, getmousepos()) 2775 \ }, getmousepos())
2766 call test_setmouse(1, 50) 2776 call test_setmouse(1, 50)
2767 call assert_equal(#{ 2777 call assert_equal(#{
2768 \ screenrow: 1, 2778 \ screenrow: 1,
2769 \ screencol: 50, 2779 \ screencol: 50,
2770 \ winid: win_getid(), 2780 \ winid: win_getid(),
2771 \ winrow: 1, 2781 \ winrow: 1,
2772 \ wincol: 50, 2782 \ wincol: 50,
2773 \ line: 1, 2783 \ line: 1,
2774 \ column: 29, 2784 \ column: 8,
2775 \ }, getmousepos()) 2785 \ }, getmousepos())
2776 bwipe! 2786 bwipe!
2777 endfunc 2787 endfunc
2778 2788
2779 " Test for glob() 2789 " Test for glob()