@@ -2337,12 +2337,15 @@ func Test_terminal_in_popup()
23372337 \ ' hi PopTerm ctermbg=grey' ,
23382338 \ ' func OpenTerm(setColor)' ,
23392339 \ " let buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})" ,
2340- \ ' let winid = popup_create(buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})' ,
2340+ \ ' let s: winid = popup_create(buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})' ,
23412341 \ ' if a:setColor' ,
2342- \ ' call win_execute(winid, "set wincolor=PopTerm")' ,
2342+ \ ' call win_execute(s: winid, "set wincolor=PopTerm")' ,
23432343 \ ' endif' ,
23442344 \ ' endfunc' ,
23452345 \ ' call OpenTerm(0)' ,
2346+ \ ' func HidePopup()' ,
2347+ \ ' call popup_hide(s:winid)' ,
2348+ \ ' endfunc' ,
23462349 \ ]
23472350 call writefile (lines , ' XtermPopup' )
23482351 let buf = RunVimInTerminal (' -S XtermPopup' , #{rows: 15 })
@@ -2356,6 +2359,10 @@ func Test_terminal_in_popup()
23562359 call term_sendkeys (buf , " /edit\<CR> " )
23572360 call VerifyScreenDump (buf , ' Test_terminal_popup_3' , {})
23582361
2362+ call term_sendkeys (buf , " \<C-W> :call HidePopup()\<CR> " )
2363+ call VerifyScreenDump (buf , ' Test_terminal_popup_4' , {})
2364+ call term_sendkeys (buf , " \<CR> " )
2365+
23592366 call term_sendkeys (buf , " :q\<CR> " )
23602367 call term_wait (buf , 100 ) " wait for terminal to vanish
23612368
0 commit comments