diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-06 22:13:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-06 22:13:01 +0200 |
commit | 00d253e2b2f435a5386582c3f857008e7ac355c2 (patch) | |
tree | 71bbea4e4c6efa593a85266e445d82377a65f454 /src/menu.c | |
parent | ee4e0c1e9a81cb5d96e0060203a9033c2f28588e (diff) | |
download | vim-git-00d253e2b2f435a5386582c3f857008e7ac355c2.tar.gz |
patch 8.2.0523: loops are repeatedv8.2.0523
Problem: Loops are repeated.
Solution: Use FOR_ALL_ macros. (Yegappan Lakshmanan, closes #5882)
Diffstat (limited to 'src/menu.c')
-rw-r--r-- | src/menu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/menu.c b/src/menu.c index 0c8887945..38b4fd8af 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1980,7 +1980,7 @@ show_popupmenu(void) apply_autocmds(EVENT_MENUPOPUP, (char_u*)mode, NULL, FALSE, curbuf); - for (menu = root_menu; menu != NULL; menu = menu->next) + FOR_ALL_MENUS(menu) if (STRNCMP("PopUp", menu->name, 5) == 0 && STRNCMP(menu->name + 5, mode, mode_len) == 0) break; @@ -2133,7 +2133,7 @@ gui_is_menu_shortcut(int key) if (key < 256) key = TOLOWER_LOC(key); - for (menu = root_menu; menu != NULL; menu = menu->next) + FOR_ALL_MENUS(menu) if (menu->mnemonic == key || (menu->mnemonic < 256 && TOLOWER_LOC(menu->mnemonic) == key)) return TRUE; |