popup_mask_refresh = TRUE;
}
+ static void
+error_for_popup_window(void)
+{
+ emsg(_("E994: Not allowed in a popup window"));
+}
+
+ int
+error_if_popup_window(int also_with_term UNUSED)
+{
+ // win_execute() may set "curwin" to a popup window temporarily, but many
+ // commands are disallowed then. When a terminal runs in the popup most
+ // things are allowed. When a terminal is finished it can be closed.
+ if (WIN_IS_POPUP(curwin)
+# ifdef FEAT_TERMINAL
+ && (also_with_term || curbuf->b_term == NULL)
+ && !term_is_finished(curbuf)
+# endif
+ )
+ {
+ error_for_popup_window();
+ return TRUE;
+ }
+ return FALSE;
+}
+
/*
* Close a popup window by Window-id.
* Does not invoke the callback.
{
if (wp == curwin)
{
- ERROR_IF_ANY_POPUP_WINDOW;
+ error_for_popup_window();
return;
}
if (prev == NULL)
{
if (wp == curwin)
{
- ERROR_IF_ANY_POPUP_WINDOW;
+ error_for_popup_window();
return;
}
if (prev == NULL)
}
}
- int
-error_if_popup_window(int also_with_term UNUSED)
-{
- // win_execute() may set "curwin" to a popup window temporarily, but many
- // commands are disallowed then. When a terminal runs in the popup most
- // things are allowed. When a terminal is finished it can be closed.
- if (WIN_IS_POPUP(curwin)
-# ifdef FEAT_TERMINAL
- && (also_with_term || curbuf->b_term == NULL)
- && !term_is_finished(curbuf)
-# endif
- )
- {
- emsg(_("E994: Not allowed in a popup window"));
- return TRUE;
- }
- return FALSE;
-}
-
# if defined(FEAT_TERMINAL) || defined(PROTO)
/*
* Return TRUE if the current window is running a terminal in a popup window.