diff src/ex_docmd.c @ 862:bb084e291010

updated for version 7.0g03
author vimboss
date Thu, 04 May 2006 21:47:50 +0000
parents 99305c4c42d4
children 5de6b337e1a2
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2997,11 +2997,14 @@ cmd_exists(name)
 	    return (cmdmods[i].name[j] == NUL ? 2 : 1);
     }
 
-    /* Check built-in commands and user defined commands. */
-    ea.cmd = name;
+    /* Check built-in commands and user defined commands.
+     * For ":2match" and ":3match" we need to skip the number. */
+    ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name;
     ea.cmdidx = (cmdidx_T)0;
     if (find_command(&ea, &full) == NULL)
 	return 3;
+    if (vim_isdigit(*name) && ea.cmdidx != CMD_match)
+	return 0;
     return (ea.cmdidx == CMD_SIZE ? 0 : (full ? 2 : 1));
 }
 #endif