@@ -1310,7 +1310,7 @@ func Test_notifications()
13101310 call delete (' XtestNotifications' )
13111311endfunc
13121312
1313- function Test_popup_settext ()
1313+ func Test_popup_settext ()
13141314 if ! CanRunVimInTerminal ()
13151315 throw ' Skipped: cannot make screendumps'
13161316 endif
@@ -1352,4 +1352,38 @@ function Test_popup_settext()
13521352 " clean up
13531353 call StopVimInTerminal (buf )
13541354 call delete (' XtestPopupSetText' )
1355- endfunction
1355+ endfunc
1356+
1357+ func Test_popup_hidden ()
1358+ new
1359+
1360+ let winid = popup_atcursor (' text' , {' hidden' : 1 })
1361+ redraw
1362+ call assert_equal (0 , popup_getpos (winid).visible)
1363+ call popup_close (winid)
1364+
1365+ let winid = popup_create (' text' , {' hidden' : 1 })
1366+ redraw
1367+ call assert_equal (0 , popup_getpos (winid).visible)
1368+ call popup_close (winid)
1369+
1370+ func QuitCallback (id, res )
1371+ let s: cb_winid = a: id
1372+ let s: cb_res = a: res
1373+ endfunc
1374+ let winid = popup_dialog (' make a choice' , {' hidden' : 1 ,
1375+ \ ' filter' : ' popup_filter_yesno' ,
1376+ \ ' callback' : ' QuitCallback' ,
1377+ \ })
1378+ redraw
1379+ call assert_equal (0 , popup_getpos (winid).visible)
1380+ exe " normal anot used by filter\<Esc> "
1381+ call assert_equal (' not used by filter' , getline (1 ))
1382+
1383+ call popup_show (winid)
1384+ call feedkeys (' y' , " xt" )
1385+ call assert_equal (1 , s: cb_res )
1386+
1387+ bwipe!
1388+ delfunc QuitCallback
1389+ endfunc
0 commit comments