aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/menu.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-11-26 15:54:03 +0300
committerZyX <kp-pav@yandex.ru>2017-11-26 15:54:03 +0300
commitb9c78130587e42ca3b6417b47fb739a166da8eb7 (patch)
tree142cf7dd0a87dfb32a20838e7683dd1980e4b3e7 /src/nvim/menu.c
parent05a3c12118a6dae0ac8f3603f9ee4d9fd9450cce (diff)
parent207b7ca4bc16d52641eaa5244eef25a0dba91dbc (diff)
downloadrneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.gz
rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.bz2
rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.zip
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r--src/nvim/menu.c21
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);
+ }
}
/*