summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-05 21:06:23 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-05 21:06:23 +0100
commit29a2c08d792e4458a0af8371f5341394829fce29 (patch)
tree1b02aeac272844df0c3749454697dbf5a63f33cc /src/ex_docmd.c
parent28ada699c13833219acaeb7e768acc2acae50e02 (diff)
patch 8.0.1570: can't use :popup for a menu in the terminalv8.0.1570
Problem: Can't use :popup for a menu in the terminal. (Wei Zhang) Solution: Make :popup work in the terminal. Also fix that entries were included that don't work in the current state.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0a51d8eb7d..f913fb5278 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -204,7 +204,8 @@ static void ex_tearoff(exarg_T *eap);
#else
# define ex_tearoff ex_ni
#endif
-#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
+#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
static void ex_popup(exarg_T *eap);
#else
# define ex_popup ex_ni
@@ -8741,11 +8742,21 @@ ex_tearoff(exarg_T *eap)
}
#endif
-#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
+#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
static void
ex_popup(exarg_T *eap)
{
- gui_make_popup(eap->arg, eap->forceit);
+# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)
+ if (gui.in_use)
+ gui_make_popup(eap->arg, eap->forceit);
+# ifdef FEAT_TERM_POPUP_MENU
+ else
+# endif
+# endif
+# ifdef FEAT_TERM_POPUP_MENU
+ pum_make_popup(eap->arg, eap->forceit);
+# endif
}
#endif