aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/menu.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-23 08:12:44 +0800
committerGitHub <noreply@github.com>2023-04-23 08:12:44 +0800
commit431b152726013ec6a5cece0285e7c103673bc511 (patch)
tree8feae947c1f7672f1ac03c2e3f2dc91ad291c115 /src/nvim/menu.c
parent540d6c595bc8e1b298dce51211b5d39e25e17d03 (diff)
downloadrneovim-431b152726013ec6a5cece0285e7c103673bc511.tar.gz
rneovim-431b152726013ec6a5cece0285e7c103673bc511.tar.bz2
rneovim-431b152726013ec6a5cece0285e7c103673bc511.zip
vim-patch:9.0.1479: small source file problems; outdated list of distrib. files (#23272)
Problem: Small source file problems; outdated list of distributed files. Solution: Small updates to source files and list of distributed files. https://github.com/vim/vim/commit/f39d9e9dca443e42920066be3a98fd9780e4ed33 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r--src/nvim/menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index b9afa2e7a4..65b6363f4b 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -1450,7 +1450,8 @@ void show_popupmenu(void)
/// Execute "menu". Use by ":emenu" and the window toolbar.
/// @param eap NULL for the window toolbar.
-/// @param mode_idx specify a MENU_INDEX_ value, use -1 to depend on the current state
+/// @param mode_idx specify a MENU_INDEX_ value,
+/// use MENU_INDEX_INVALID to depend on the current state
void execute_menu(const exarg_T *eap, vimmenu_T *menu, int mode_idx)
FUNC_ATTR_NONNULL_ARG(2)
{
@@ -1458,7 +1459,7 @@ void execute_menu(const exarg_T *eap, vimmenu_T *menu, int mode_idx)
if (idx < 0) {
// Use the Insert mode entry when returning to Insert mode.
- if (((State & MODE_INSERT) || restart_edit) && !current_sctx.sc_sid) {
+ if (((State & MODE_INSERT) || restart_edit) && current_sctx.sc_sid == 0) {
idx = MENU_INDEX_INSERT;
} else if (State & MODE_CMDLINE) {
idx = MENU_INDEX_CMDLINE;
@@ -1612,7 +1613,7 @@ static vimmenu_T *menu_getbyname(char *name_arg)
void ex_emenu(exarg_T *eap)
{
char *arg = eap->arg;
- int mode_idx = -1;
+ int mode_idx = MENU_INDEX_INVALID;
if (arg[0] && ascii_iswhite(arg[1])) {
switch (arg[0]) {