unlet s:winid
endfunc
+func Test_terminal_popup_bufload()
+ let termbuf = term_start(&shell, #{hidden: v:true, term_finish: 'close'})
+ let winid = popup_create(termbuf, {})
+ sleep 50m
+
+ let newbuf = bufadd('')
+ call bufload(newbuf)
+ call setbufline(newbuf, 1, 'foobar')
+
+ " must not have switched to another window
+ call assert_equal(winid, win_getid())
+
+ call feedkeys("exit\<CR>", 'xt')
+ sleep 50m
+ exe 'bwipe! ' .. newbuf
+endfunc
+
func Test_terminal_popup_insert_cmd()
CheckUnix
/*
* Find window "id" in the current tab page.
+ * Also find popup windows.
* Return NULL if not found.
*/
win_T *
FOR_ALL_WINDOWS(wp)
if (wp->w_id == id)
return wp;
+#ifdef FEAT_PROP_POPUP
+ FOR_ALL_POPUPWINS(wp)
+ if (wp->w_id == id)
+ return wp;
+ FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
+ if (wp->w_id == id)
+ return wp;
+#endif
return NULL;
}