changeset 20075:516b10943fdb v8.2.0593

patch 8.2.0593: finding a user command is not optimal Commit: https://github.com/vim/vim/commit/a494f56f885876c98a276f7acfa386bfbb344680 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 18 17:45:38 2020 +0200 patch 8.2.0593: finding a user command is not optimal Problem: Finding a user command is not optimal. Solution: Start further down in the list of commands.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Apr 2020 18:00:03 +0200
parents 0cd280c8a279
children 023d3226e727
files src/ex_cmds.h src/ex_docmd.c src/version.c
diffstat 3 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1775,7 +1775,7 @@ EXCMD(CMD_z,		"z",		ex_z,
 	EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_FLAGS|EX_TRLBAR|EX_CMDWIN,
 	ADDR_LINES),
 
-// commands that don't start with a lowercase letter
+// commands that don't start with a letter
 EXCMD(CMD_bang,		"!",		ex_bang,
 	EX_RANGE|EX_WHOLEFOLD|EX_BANG|EX_FILES|EX_CMDWIN,
 	ADDR_LINES),
@@ -1800,6 +1800,11 @@ EXCMD(CMD_rshift,	">",		ex_operators,
 EXCMD(CMD_at,		"@",		ex_at,
 	EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_TRLBAR|EX_CMDWIN,
 	ADDR_LINES),
+EXCMD(CMD_tilde,	"~",		do_sub,
+	EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_MODIFY,
+	ADDR_LINES),
+
+// commands that start with an uppercase letter
 EXCMD(CMD_Next,		"Next",		ex_previous,
 	EX_EXTRA|EX_RANGE|EX_COUNT|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
 	ADDR_OTHER),
@@ -1809,9 +1814,6 @@ EXCMD(CMD_Print,	"Print",	ex_print,
 EXCMD(CMD_X,		"X",		ex_X,
 	EX_TRLBAR,
 	ADDR_NONE),
-EXCMD(CMD_tilde,	"~",		do_sub,
-	EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_MODIFY,
-	ADDR_LINES),
 
 #undef EXCMD
 
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3153,9 +3153,9 @@ append_command(char_u *cmd)
     char_u *
 find_ex_command(
 	exarg_T *eap,
-	int *full UNUSED,
-	int (*lookup)(char_u *, size_t, cctx_T *) UNUSED,
-	cctx_T *cctx UNUSED)
+	int	*full UNUSED,
+	int	(*lookup)(char_u *, size_t, cctx_T *) UNUSED,
+	cctx_T	*cctx UNUSED)
 {
     int		len;
     char_u	*p;
@@ -3285,6 +3285,8 @@ find_ex_command(
 	    if (ASCII_ISLOWER(c2))
 		eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)];
 	}
+	else if (ASCII_ISUPPER(eap->cmd[0]))
+	    eap->cmdidx = CMD_Next;
 	else
 	    eap->cmdidx = CMD_bang;
 
@@ -4766,7 +4768,7 @@ ex_blast(exarg_T *eap)
 
 /*
  * Check if "c" ends an Ex command.
- * In Vim9 script does not check for white space before #.
+ * In Vim9 script does not check for white space before # or #{.
  */
     int
 ends_excmd(int c)
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    593,
+/**/
     592,
 /**/
     591,