0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

updated for version 7.0-062

This commit is contained in:
Bram Moolenaar
2006-08-16 19:41:08 +00:00
parent f83c5c0113
commit 968bbbe436
5 changed files with 34 additions and 1 deletions

View File

@@ -1777,6 +1777,27 @@ get_menu_mode()
return MENU_INDEX_INVALID;
}
/*
* Check that a pointer appears in the menu tree. Used to protect from using
* a menu that was deleted after it was selected but before the event was
* handled.
* Return OK or FAIL. Used recursively.
*/
int
check_menu_pointer(root, menu_to_check)
vimmenu_T *root;
vimmenu_T *menu_to_check;
{
vimmenu_T *p;
for (p = root; p != NULL; p = p->next)
if (p == menu_to_check
|| (p->children != NULL
&& check_menu_pointer(p->children, menu_to_check) == OK))
return OK;
return FAIL;
}
/*
* After we have started the GUI, then we can create any menus that have been
* defined. This is done once here. add_menu_path() may have already been