@@ -371,6 +371,24 @@ func Test_popup_firstline()
371371 call popup_close (winid)
372372endfunc
373373
374+ func Test_popup_noscrolloff ()
375+ set scrolloff = 5
376+ let winid = popup_create ([' xxx' ]- >repeat (50 ), #{
377+ \ maxheight: 5 ,
378+ \ firstline: 11 ,
379+ \ })
380+ redraw
381+ call assert_equal (11 , popup_getoptions (winid).firstline)
382+ call assert_equal (11 , popup_getpos (winid).firstline)
383+
384+ call popup_setoptions (winid, #{firstline: 0 })
385+ call win_execute (winid, " normal! \<c-y> " )
386+ call assert_equal (0 , popup_getoptions (winid).firstline)
387+ call assert_equal (10 , popup_getpos (winid).firstline)
388+
389+ call popup_close (winid)
390+ endfunc
391+
374392func Test_popup_drag ()
375393 CheckScreendump
376394
@@ -1019,14 +1037,18 @@ func Test_popup_option_values()
10191037 " global/buffer-local
10201038 setlocal path = /there
10211039 " global/window-local
1022- setlocal scrolloff = 9
1040+ setlocal statusline = 2
10231041
10241042 let winid = popup_create (' hello' , {})
10251043 call assert_equal (0 , getwinvar (winid, ' &number' ))
10261044 call assert_equal (1 , getwinvar (winid, ' &wrap' ))
10271045 call assert_equal (' ' , getwinvar (winid, ' &omnifunc' ))
10281046 call assert_equal (&g: path , getwinvar (winid, ' &path' ))
1029- call assert_equal (&g: scrolloff , getwinvar (winid, ' &scrolloff' ))
1047+ call assert_equal (&g: statusline , getwinvar (winid, ' &statusline' ))
1048+
1049+ " 'scrolloff' is reset to zero
1050+ call assert_equal (5 , &scrolloff )
1051+ call assert_equal (0 , getwinvar (winid, ' &scrolloff' ))
10301052
10311053 call popup_close (winid)
10321054 bwipe
@@ -1713,6 +1735,7 @@ func Test_popup_scrollbar()
17131735 call VerifyScreenDump (buf , ' Test_popupwin_scroll_4' , {})
17141736
17151737 call term_sendkeys (buf , " :call popup_setoptions(winid, #{scrollbarhighlight: 'ScrollBar', thumbhighlight: 'ScrollThumb', firstline: 5})\<CR> " )
1738+ " this scrolls two lines (half the window height)
17161739 call term_sendkeys (buf , " :call ScrollUp()\<CR> " )
17171740 call VerifyScreenDump (buf , ' Test_popupwin_scroll_5' , {})
17181741
0 commit comments