diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-10-13 19:18:04 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-10-13 19:18:04 +0200 |
commit | 23d1b62746dce048c80cc19e7e5af1d513b6b4cf (patch) | |
tree | fdb2f81d29bd5cbab24845208f3d921279e45d20 /src/ex_docmd.c | |
parent | f59c73da1e8eb16e7b49b4465aedd1d6ddacc6fd (diff) |
patch 7.4.895v7.4.895
Problem: Custom command line completion does not work for a command
containing digits.
Solution: Skip over the digits. (suggested by Yasuhiro Matsumoto)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index c3a01df9fb..23514fb124 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3517,9 +3517,10 @@ set_one_cmd_context(xp, buff) p = cmd; while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */ ++p; - /* check for non-alpha command */ - if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) - ++p; + /* a user command may contain digits */ + if (ASCII_ISUPPER(cmd[0])) + while (ASCII_ISALNUM(*p) || *p == '*') + ++p; /* for python 3.x: ":py3*" commands completion */ if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3') { @@ -3527,6 +3528,9 @@ set_one_cmd_context(xp, buff) while (ASCII_ISALPHA(*p) || *p == '*') ++p; } + /* check for non-alpha command */ + if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) + ++p; len = (int)(p - cmd); if (len == 0) |