summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-08-16 19:41:08 +0000
committerBram Moolenaar <Bram@vim.org>2006-08-16 19:41:08 +0000
commit968bbbe436ce87903ae22084635aa18004967da1 (patch)
treed7322482074062119d398beff61fcebe942ee2f3 /src/menu.c
parentf83c5c0113cdfbdc176dcdf65baca77f436ed54f (diff)
downloadvim-git-968bbbe436ce87903ae22084635aa18004967da1.tar.gz
updated for version 7.0-062v7.0.062
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/menu.c b/src/menu.c
index 80ada2c8e..926f4c124 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1778,6 +1778,27 @@ get_menu_mode()
}
/*
+ * 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
* called to define these menus, and may be called again. This function calls