summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-20 19:47:37 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-20 19:47:37 +0100
commit0044e5100a0e76a0bc1ea18c63a432c20428de5e (patch)
treee3ad4e3fdeb6ec2997ec5b061b72410abefaa697 /src/testdir/test_popupwin.vim
parentdbec26d7893dca4ff38fa4b96ac91203d30ccae5 (diff)
downloadvim-git-0044e5100a0e76a0bc1ea18c63a432c20428de5e.tar.gz
patch 8.2.4799: popup does not use correct toplinev8.2.4799
Problem: Popup does not use correct topline. Solution: Also add one when firstline is negative. (closes #10229)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index b91689e50..3e5373ca8 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -514,6 +514,19 @@ func Test_popup_firstline()
call assert_equal(5, popup_getpos(winid).firstline)
call popup_close(winid)
+
+ " Popup with less elements than the maximum height and negative firstline:
+ " check that the popup height is correctly computed.
+ let winid = popup_create(['xxx']->repeat(4), #{
+ \ firstline: -1,
+ \ maxheight: 6,
+ \ })
+
+ let pos = popup_getpos(winid)
+ call assert_equal(3, pos.width)
+ call assert_equal(4, pos.height)
+
+ call popup_close(winid)
endfunc
func Test_popup_firstline_cursorline()