@@ -142,6 +142,7 @@ func Test_popup_with_border_and_padding()
142142 \ height: 3 ,
143143 \ core_height: 1 ,
144144 \ firstline: 1 ,
145+ \ lastline: 1 ,
145146 \ scrollbar : 0 ,
146147 \ visible: 1 }
147148 let winid = popup_create (' hello border' , #{line : 2 , col : 3 , border: []})" ,
@@ -186,6 +187,7 @@ func Test_popup_with_border_and_padding()
186187 \ scrollbar : 0 ,
187188 \ core_height: 1 ,
188189 \ firstline: 1 ,
190+ \ lastline: 1 ,
189191 \ visible: 1 }, popup_getpos (winid))
190192
191193 call popup_clear ()
@@ -385,6 +387,24 @@ func Test_popup_firstline()
385387 call assert_equal (0 , popup_getoptions (winid).firstline)
386388 call assert_equal (10 , popup_getpos (winid).firstline)
387389
390+ " CTRL-D scrolls down half a page
391+ let winid = popup_create ([' xxx' ]- >repeat (50 ), #{
392+ \ maxheight: 8 ,
393+ \ })
394+ redraw
395+ call assert_equal (1 , popup_getpos (winid).firstline)
396+ call win_execute (winid, " normal! \<C-D> " )
397+ call assert_equal (5 , popup_getpos (winid).firstline)
398+ call win_execute (winid, " normal! \<C-D> " )
399+ call assert_equal (9 , popup_getpos (winid).firstline)
400+ call win_execute (winid, " normal! \<C-U> " )
401+ call assert_equal (5 , popup_getpos (winid).firstline)
402+
403+ call win_execute (winid, " normal! \<C-F> " )
404+ call assert_equal (11 , popup_getpos (winid).firstline)
405+ call win_execute (winid, " normal! \<C-B> " )
406+ call assert_equal (5 , popup_getpos (winid).firstline)
407+
388408 call popup_close (winid)
389409endfunc
390410
@@ -1795,6 +1815,7 @@ func Test_popup_scrollbar()
17951815 \ minheight: 4 ,
17961816 \ maxheight: 4 ,
17971817 \ firstline: 1 ,
1818+ \ lastline: 4 ,
17981819 \ wrap : v: true ,
17991820 \ scrollbar : v: true ,
18001821 \ mapping : v: false ,
0 commit comments