diff options
Diffstat (limited to 'src/testdir/test_cursor_func.vim')
-rw-r--r-- | src/testdir/test_cursor_func.vim | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim index bc12511af..7d21d8472 100644 --- a/src/testdir/test_cursor_func.vim +++ b/src/testdir/test_cursor_func.vim @@ -1,5 +1,7 @@ " Tests for cursor() and other functions that get/set the cursor position +source check.vim + func Test_wrong_arguments() call assert_fails('call cursor(1. 3)', 'E474:') call assert_fails('call cursor(test_null_list())', 'E474:') @@ -133,12 +135,27 @@ func Test_screenpos() bwipe! set display& - call assert_equal({'col': 1, 'row': 1, 'endcol': 1, 'curscol': 1}, screenpos(win_getid(), 1, 1)) + call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) nmenu WinBar.TEST : - call assert_equal({'col': 1, 'row': 2, 'endcol': 1, 'curscol': 1}, screenpos(win_getid(), 1, 1)) + call assert_equal(#{col: 1, row: 2, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) nunmenu WinBar.TEST endfunc +func Test_screenpos_fold() + CheckFeature folding + + enew! + call setline(1, range(10)) + 3,5fold + redraw + call assert_equal(2, screenpos(1, 2, 1).row) + call assert_equal(#{col: 1, row: 3, endcol: 1, curscol: 1}, screenpos(1, 3, 1)) + call assert_equal(3, screenpos(1, 4, 1).row) + call assert_equal(3, screenpos(1, 5, 1).row) + call assert_equal(4, screenpos(1, 6, 1).row) + bwipe! +endfunc + func Test_screenpos_number() rightbelow new rightbelow 73vsplit |