diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-11-22 23:12:30 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-22 23:12:30 +0100 |
commit | 8c959be51104fbf2aa01aa09f82df6cec515770c (patch) | |
tree | 045eab5e6aa1819c1ab13fcf1967c4a59cb82870 /src/nvim/menu.c | |
parent | a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b (diff) | |
parent | fe2546c81a8a7c0be5bbf0737d1169f6cd49bba0 (diff) | |
download | rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.tar.gz rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.tar.bz2 rneovim-8c959be51104fbf2aa01aa09f82df6cec515770c.zip |
Merge #7593 'PVS static analysis fixes'
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r-- | src/nvim/menu.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 88d968704b..01c8e94bac 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -1417,17 +1417,20 @@ void ex_emenu(exarg_T *eap) idx = MENU_INDEX_NORMAL; } - if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL) { - /* When executing a script or function execute the commands right now. - * Otherwise put them in the typeahead buffer. */ - if (current_SID != 0) + assert(idx != MENU_INDEX_INVALID); + if (menu->strings[idx] != NULL) { + // When executing a script or function execute the commands right now. + // Otherwise put them in the typeahead buffer. + if (current_SID != 0) { exec_normal_cmd(menu->strings[idx], menu->noremap[idx], - menu->silent[idx]); - else - ins_typebuf(menu->strings[idx], menu->noremap[idx], 0, - TRUE, menu->silent[idx]); - } else + menu->silent[idx]); + } else { + ins_typebuf(menu->strings[idx], menu->noremap[idx], 0, true, + menu->silent[idx]); + } + } else { EMSG2(_("E335: Menu not defined for %s mode"), mode); + } } /* |