diff src/menu.c @ 16541:822d00007b34 v8.1.1274

patch 8.1.1274: after :unmenu can still execute the menu with :emenu commit https://github.com/vim/vim/commit/ce79353ace9e21238f13655089363cd23cbb6b32 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 5 14:19:20 2019 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 May 2019 14:30:05 +0200
parents a7299d144bb9
children ef00b6bc186b
line wrap: on
line diff
--- a/src/menu.c
+++ b/src/menu.c
@@ -2337,7 +2337,8 @@ execute_menu(exarg_T *eap, vimmenu_T *me
     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.