diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-22 21:55:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-22 21:55:41 +0200 |
commit | 99ca9c4868bb1669706b9e3de9a9218bd11cc459 (patch) | |
tree | 5ee65a27548647c2ef50b21435433a6bd7299d9f /src/testdir | |
parent | 4f73b8e9cc83f647b34002554a8bdf9abec0a82f (diff) | |
download | vim-git-99ca9c4868bb1669706b9e3de9a9218bd11cc459.tar.gz |
patch 8.2.1727: a popup created with "cursorline" will ignore "firstline"v8.2.1727
Problem: A popup created with "cursorline" will ignore "firstline".
Solution: When both "cursorline" and "firstline" are present put the cursor
on "firstline". (closes #7000) Add the "winid" argument to
getcurpos().
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_functions.vim | 12 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 7ff9b7a81..2492c9379 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2520,7 +2520,19 @@ func Test_getcurpos_setpos() call assert_equal('6', @") call assert_equal(-1, setpos('.', test_null_list())) call assert_equal(-1, setpos('.', {})) + + let winid = win_getid() + normal G$ + let pos = getcurpos() + wincmd w + call assert_equal(pos, getcurpos(winid)) + + wincmd w close! + + call assert_equal(getcurpos(), getcurpos(0)) + call assert_equal([0, 0, 0, 0, 0], getcurpos(-1)) + call assert_equal([0, 0, 0, 0, 0], getcurpos(1999)) endfunc " Test for glob() diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 954086cae..333e9a284 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -516,6 +516,19 @@ func Test_popup_firstline() call popup_close(winid) endfunc +func Test_popup_firstline_cursorline() + let winid = popup_create(['1111', '222222', '33333', '44444'], #{ + \ maxheight: 2, + \ firstline: 3, + \ cursorline: 1, + \ }) + call assert_equal(3, popup_getoptions(winid).firstline) + call assert_equal(3, getwininfo(winid)[0].topline) + call assert_equal(3, getcurpos(winid)[1]) + + call popup_close(winid) +endfunc + func Test_popup_noscrolloff() set scrolloff=5 let winid = popup_create(['xxx']->repeat(50), #{ |