diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-09-05 12:50:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 12:50:38 +0200 |
commit | 79ea47d47836154cfb5a9574faa5c2af8422486a (patch) | |
tree | e3498beaa706b1424e71d142d1d01b809056f59b /src/nvim/testdir/test_cursor_func.vim | |
parent | 632ee8d2ed6e307cc4d9ca2cf9e3ba0531a8af51 (diff) | |
parent | d5162afa2aee6609bf5d4f818639235b70c57a9a (diff) | |
download | rneovim-79ea47d47836154cfb5a9574faa5c2af8422486a.tar.gz rneovim-79ea47d47836154cfb5a9574faa5c2af8422486a.tar.bz2 rneovim-79ea47d47836154cfb5a9574faa5c2af8422486a.zip |
Merge pull request #10451 from bfredl/floatbuf
anchor float to buffer position
Diffstat (limited to 'src/nvim/testdir/test_cursor_func.vim')
-rw-r--r-- | src/nvim/testdir/test_cursor_func.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim index 6bc9535aaf..037918fa31 100644 --- a/src/nvim/testdir/test_cursor_func.vim +++ b/src/nvim/testdir/test_cursor_func.vim @@ -64,3 +64,31 @@ func Test_curswant_with_cursorline() call assert_equal(6, winsaveview().curswant) quit! endfunc + +func Test_screenpos() + rightbelow new + rightbelow 20vsplit + call setline(1, ["\tsome text", "long wrapping line here", "next line"]) + redraw + let winid = win_getid() + let [winrow, wincol] = win_screenpos(winid) + call assert_equal({'row': winrow, + \ 'col': wincol + 0, + \ 'curscol': wincol + 7, + \ 'endcol': wincol + 7}, screenpos(winid, 1, 1)) + call assert_equal({'row': winrow, + \ 'col': wincol + 13, + \ 'curscol': wincol + 13, + \ 'endcol': wincol + 13}, screenpos(winid, 1, 7)) + call assert_equal({'row': winrow + 2, + \ 'col': wincol + 1, + \ 'curscol': wincol + 1, + \ 'endcol': wincol + 1}, screenpos(winid, 2, 22)) + setlocal number + call assert_equal({'row': winrow + 3, + \ 'col': wincol + 9, + \ 'curscol': wincol + 9, + \ 'endcol': wincol + 9}, screenpos(winid, 2, 22)) + close + bwipe! +endfunc |