Mercurial > vim
comparison src/ex_docmd.c @ 7168:0f2807c05687 v7.4.895
commit https://github.com/vim/vim/commit/23d1b62746dce048c80cc19e7e5af1d513b6b4cf
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 13 19:18:04 2015 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Oct 2015 19:30:05 +0200 |
parents | 48ce650e8a27 |
children | fadf7fc3b666 |
comparison
equal
deleted
inserted
replaced
7167:aa92e9acfb6f | 7168:0f2807c05687 |
---|---|
3515 else | 3515 else |
3516 { | 3516 { |
3517 p = cmd; | 3517 p = cmd; |
3518 while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */ | 3518 while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */ |
3519 ++p; | 3519 ++p; |
3520 /* a user command may contain digits */ | |
3521 if (ASCII_ISUPPER(cmd[0])) | |
3522 while (ASCII_ISALNUM(*p) || *p == '*') | |
3523 ++p; | |
3524 /* for python 3.x: ":py3*" commands completion */ | |
3525 if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3') | |
3526 { | |
3527 ++p; | |
3528 while (ASCII_ISALPHA(*p) || *p == '*') | |
3529 ++p; | |
3530 } | |
3520 /* check for non-alpha command */ | 3531 /* check for non-alpha command */ |
3521 if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) | 3532 if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) |
3522 ++p; | 3533 ++p; |
3523 /* for python 3.x: ":py3*" commands completion */ | |
3524 if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3') | |
3525 { | |
3526 ++p; | |
3527 while (ASCII_ISALPHA(*p) || *p == '*') | |
3528 ++p; | |
3529 } | |
3530 len = (int)(p - cmd); | 3534 len = (int)(p - cmd); |
3531 | 3535 |
3532 if (len == 0) | 3536 if (len == 0) |
3533 { | 3537 { |
3534 xp->xp_context = EXPAND_UNSUCCESSFUL; | 3538 xp->xp_context = EXPAND_UNSUCCESSFUL; |