diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-03 22:29:38 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-03 22:29:38 +0100 |
commit | 30efcf3d26bd14af71cd306c4c5f9e789a7130c9 (patch) | |
tree | 515d0e5a4b3408311c2e671d3604348ad4131fe9 /src/testdir/test_popupwin.vim | |
parent | d047840ce4b770a86bacab0d62e72d0f61a2b8ab (diff) | |
download | vim-git-30efcf3d26bd14af71cd306c4c5f9e789a7130c9.tar.gz |
patch 8.1.2250: CTRL-U and CTRL-D don't work in popup windowv8.1.2250
Problem: CTRL-U and CTRL-D don't work in popup window.
Solution: Initialize 'scroll'. Add "lastline" in popup_getpos().
(closes #5170)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r-- | src/testdir/test_popupwin.vim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 2c4da0b79..e38b7211e 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -142,6 +142,7 @@ func Test_popup_with_border_and_padding() \ height: 3, \ core_height: 1, \ firstline: 1, + \ lastline: 1, \ scrollbar: 0, \ visible: 1} let winid = popup_create('hello border', #{line: 2, col: 3, border: []})", @@ -186,6 +187,7 @@ func Test_popup_with_border_and_padding() \ scrollbar: 0, \ core_height: 1, \ firstline: 1, + \ lastline: 1, \ visible: 1}, popup_getpos(winid)) call popup_clear() @@ -385,6 +387,24 @@ func Test_popup_firstline() call assert_equal(0, popup_getoptions(winid).firstline) call assert_equal(10, popup_getpos(winid).firstline) + " CTRL-D scrolls down half a page + let winid = popup_create(['xxx']->repeat(50), #{ + \ maxheight: 8, + \ }) + redraw + call assert_equal(1, popup_getpos(winid).firstline) + call win_execute(winid, "normal! \<C-D>") + call assert_equal(5, popup_getpos(winid).firstline) + call win_execute(winid, "normal! \<C-D>") + call assert_equal(9, popup_getpos(winid).firstline) + call win_execute(winid, "normal! \<C-U>") + call assert_equal(5, popup_getpos(winid).firstline) + + call win_execute(winid, "normal! \<C-F>") + call assert_equal(11, popup_getpos(winid).firstline) + call win_execute(winid, "normal! \<C-B>") + call assert_equal(5, popup_getpos(winid).firstline) + call popup_close(winid) endfunc @@ -1795,6 +1815,7 @@ func Test_popup_scrollbar() \ minheight: 4, \ maxheight: 4, \ firstline: 1, + \ lastline: 4, \ wrap: v:true, \ scrollbar: v:true, \ mapping: v:false, |