summaryrefslogtreecommitdiffstats
path: root/src/menu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-05 14:19:20 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-05 14:19:20 +0200
commitce79353ace9e21238f13655089363cd23cbb6b32 (patch)
tree468d76aa7641a5b926f37da1fcf0aec1f38ce645 /src/menu.c
parentf653a6bcff48161b56eeb3a584011aab6665f1e7 (diff)
patch 8.1.1274: after :unmenu can still execute the menu with :emenuv8.1.1274
Problem: After :unmenu can still execute the menu with :emenu. Solution: Do not execute a menu that was disabled for the specified mode.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/menu.c b/src/menu.c
index 21d3e11766..6e0c02ec3b 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -2337,7 +2337,8 @@ execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx)
if (idx == -1 || eap == NULL)
idx = MENU_INDEX_NORMAL;
- if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
+ if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL
+ && (menu->modes & (1 << idx)))
{
/* When executing a script or function execute the commands right now.
* Also for the window toolbar.