forked from aniani/vim
patch 8.1.1274: after :unmenu can still execute the menu with :emenu
Problem: After :unmenu can still execute the menu with :emenu. Solution: Do not execute a menu that was disabled for the specified mode.
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user