Skip to content

Commit 23d1b62

Browse files
committed
patch 7.4.895
Problem: Custom command line completion does not work for a command containing digits. Solution: Skip over the digits. (suggested by Yasuhiro Matsumoto)
1 parent f59c73d commit 23d1b62

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/ex_docmd.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,16 +3517,20 @@ set_one_cmd_context(xp, buff)
35173517
p = cmd;
35183518
while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */
35193519
++p;
3520-
/* check for non-alpha command */
3521-
if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL)
3522-
++p;
3520+
/* a user command may contain digits */
3521+
if (ASCII_ISUPPER(cmd[0]))
3522+
while (ASCII_ISALNUM(*p) || *p == '*')
3523+
++p;
35233524
/* for python 3.x: ":py3*" commands completion */
35243525
if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3')
35253526
{
35263527
++p;
35273528
while (ASCII_ISALPHA(*p) || *p == '*')
35283529
++p;
35293530
}
3531+
/* check for non-alpha command */
3532+
if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL)
3533+
++p;
35303534
len = (int)(p - cmd);
35313535

35323536
if (len == 0)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
895,
744746
/**/
745747
894,
746748
/**/

0 commit comments

Comments
 (0)