@@ -1215,6 +1215,29 @@ func Test_popup_menu_screenshot()
12151215 call delete (' XtestPopupMenu' )
12161216endfunc
12171217
1218+ func Test_popup_menu_narrow ()
1219+ if ! CanRunVimInTerminal ()
1220+ throw ' Skipped: cannot make screendumps'
1221+ endif
1222+
1223+ let lines = << trim END
1224+ call setline (1 , range (1 , 20 ))
1225+ hi PopupSelected ctermbg= green
1226+ call popup_menu ([' one' , ' two' , ' three' ], #{callback: ' MenuDone' })
1227+ func MenuDone (id, res )
1228+ echomsg " selected " .. a: res
1229+ endfunc
1230+ END
1231+ call writefile (lines , ' XtestPopupNarrowMenu' )
1232+ let buf = RunVimInTerminal (' -S XtestPopupNarrowMenu' , #{rows: 10 })
1233+ call VerifyScreenDump (buf , ' Test_popupwin_menu_04' , {})
1234+
1235+ " clean up
1236+ call term_sendkeys (buf , " x" )
1237+ call StopVimInTerminal (buf )
1238+ call delete (' XtestPopupNarrowMenu' )
1239+ endfunc
1240+
12181241func Test_popup_title ()
12191242 if ! CanRunVimInTerminal ()
12201243 throw ' Skipped: cannot make screendumps'
@@ -2093,4 +2116,50 @@ func Test_popup_cursorline()
20932116 call delete (' XtestPopupCursorLine' )
20942117endfunc
20952118
2119+ func Test_previewpopup ()
2120+ if ! CanRunVimInTerminal ()
2121+ throw ' Skipped: cannot make screendumps'
2122+ endif
2123+ call writefile ([
2124+ \ " !_TAG_FILE_ENCODING\t utf-8\t //" ,
2125+ \ " another\t Xtagfile\t /^this is another" ,
2126+ \ " theword\t Xtagfile\t /^theword" ],
2127+ \ ' Xtags' )
2128+ call writefile (range (1 ,20 )
2129+ \ + [' theword is here' ]
2130+ \ + range (22 , 27 )
2131+ \ + [' this is another place' ]
2132+ \ + range (29 , 40 ),
2133+ \ " Xtagfile" )
2134+ let lines = << trim END
2135+ set tags = Xtags
2136+ call setline (1 , [
2137+ \ ' one' ,
2138+ \ ' two' ,
2139+ \ ' three' ,
2140+ \ ' four' ,
2141+ \ ' five' ,
2142+ \ ' six' ,
2143+ \ ' seven' ,
2144+ \ ' find theword somewhere' ,
2145+ \ ' nine' ,
2146+ \ ' this is another word' ])
2147+ set previewpopup = height:4 ,width:40
2148+ END
2149+ call writefile (lines , ' XtestPreviewPopup' )
2150+ let buf = RunVimInTerminal (' -S XtestPreviewPopup' , #{rows: 14 })
2151+
2152+ call term_sendkeys (buf , " /theword\<CR>\<C-W> }" )
2153+ call term_sendkeys (buf , " :\<CR> " )
2154+ call VerifyScreenDump (buf , ' Test_popupwin_previewpopup_1' , {})
2155+
2156+ call term_sendkeys (buf , " /another\<CR>\<C-W> }" )
2157+ call VerifyScreenDump (buf , ' Test_popupwin_previewpopup_2' , {})
2158+
2159+ call StopVimInTerminal (buf )
2160+ call delete (' Xtags' )
2161+ call delete (' Xtagfile' )
2162+ call delete (' XtestPreviewPopup' )
2163+ endfunc
2164+
20962165" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments