diff src/menu.c @ 32295:bea4ebf594c6 v9.0.1479

patch 9.0.1479: small source file problems; outdated list of distrib. files Commit: https://github.com/vim/vim/commit/f39d9e9dca443e42920066be3a98fd9780e4ed33 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 22 22:54:40 2023 +0100 patch 9.0.1479: small source file problems; outdated list of distrib. files Problem: Small source file problems; outdated list of distributed files. Solution: Small updates to source files and list of distributed files.
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Apr 2023 00:00:04 +0200
parents 238ca27dbfd2
children 161ae1985d81
line wrap: on
line diff
--- a/src/menu.c
+++ b/src/menu.c
@@ -2318,8 +2318,8 @@ gui_destroy_tearoffs_recurse(vimmenu_T *
 /*
  * Execute "menu".  Use by ":emenu" and the window toolbar.
  * "eap" is NULL for the window toolbar.
- * "mode_idx" specifies a MENU_INDEX_ value, use -1 to depend on the current
- * state.
+ * "mode_idx" specifies a MENU_INDEX_ value, use MENU_INDEX_INVALID to depend
+ * on the current state.
  */
     void
 execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx)
@@ -2329,7 +2329,7 @@ execute_menu(exarg_T *eap, vimmenu_T *me
     if (idx < 0)
     {
 	// Use the Insert mode entry when returning to Insert mode.
-	if (restart_edit && !current_sctx.sc_sid)
+	if (restart_edit && current_sctx.sc_sid == 0)
 	{
 	    idx = MENU_INDEX_INSERT;
 	}
@@ -2513,7 +2513,7 @@ ex_emenu(exarg_T *eap)
 {
     vimmenu_T	*menu;
     char_u	*arg = eap->arg;
-    int		mode_idx = -1;
+    int		mode_idx = MENU_INDEX_INVALID;
 
     if (arg[0] && VIM_ISWHITE(arg[1]))
     {