diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-05 14:19:20 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-05 14:19:20 +0200 |
commit | ce79353ace9e21238f13655089363cd23cbb6b32 (patch) | |
tree | 468d76aa7641a5b926f37da1fcf0aec1f38ce645 /src/menu.c | |
parent | f653a6bcff48161b56eeb3a584011aab6665f1e7 (diff) | |
download | vim-git-ce79353ace9e21238f13655089363cd23cbb6b32.tar.gz |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/menu.c b/src/menu.c index 21d3e1176..6e0c02ec3 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. |