comparison src/menu.c @ 15375:6012cc6936f7 v8.1.0695

patch 8.1.0695: internal error when using :popup commit https://github.com/vim/vim/commit/f42b45d719e03218735b3c2845a74dca9c0efd60 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 6 13:11:05 2019 +0100 patch 8.1.0695: internal error when using :popup Problem: Internal error when using :popup. Solution: When a menu only exists in Terminal mode give an error. (Naruhiko Nishino, closes #3765)
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jan 2019 13:15:09 +0100
parents 405309f9dd13
children 55ccc2d353bd
comparison
equal deleted inserted replaced
15374:13a34f8e996b 15375:6012cc6936f7
59 59
60 /* The character for each menu mode */ 60 /* The character for each menu mode */
61 static char *menu_mode_chars[] = {"n", "v", "s", "o", "i", "c", "tl", "t"}; 61 static char *menu_mode_chars[] = {"n", "v", "s", "o", "i", "c", "tl", "t"};
62 62
63 static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu"); 63 static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
64 static char_u e_othermode[] = N_("E328: Menu only exists in another mode");
65 static char_u e_nomenu[] = N_("E329: No menu \"%s\""); 64 static char_u e_nomenu[] = N_("E329: No menu \"%s\"");
66 65
67 #ifdef FEAT_TOOLBAR 66 #ifdef FEAT_TOOLBAR
68 static const char *toolbar_names[] = 67 static const char *toolbar_names[] =
69 { 68 {
954 return FAIL; 953 return FAIL;
955 } 954 }
956 else if (*name != NUL) 955 else if (*name != NUL)
957 { 956 {
958 if (!silent) 957 if (!silent)
959 EMSG(_(e_othermode)); 958 EMSG(_(e_menuothermode));
960 return FAIL; 959 return FAIL;
961 } 960 }
962 961
963 /* 962 /*
964 * When name is empty, we are removing all menu items for the given 963 * When name is empty, we are removing all menu items for the given
1128 vim_free(path_name); 1127 vim_free(path_name);
1129 return FAIL; 1128 return FAIL;
1130 } 1129 }
1131 else if ((menu->modes & modes) == 0x0) 1130 else if ((menu->modes & modes) == 0x0)
1132 { 1131 {
1133 EMSG(_(e_othermode)); 1132 EMSG(_(e_menuothermode));
1134 vim_free(path_name); 1133 vim_free(path_name);
1135 return FAIL; 1134 return FAIL;
1136 } 1135 }
1137 break; 1136 break;
1138 } 1137 }