diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-22 00:45:51 -0500 | 
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-22 00:45:51 -0500 | 
| commit | f08fd412829f001f7b8ef714a05780a9fdd94eb1 (patch) | |
| tree | 22c2d7c17825b2944f49fad82681f8a487798823 /src/nvim/ex_docmd.c | |
| parent | 9e00724c3874ecc11dbc1d8a8cbbd79f5fd0b651 (diff) | |
| parent | 30b452b470721e10766adfc2ea4213f55e9a73b8 (diff) | |
| download | rneovim-f08fd412829f001f7b8ef714a05780a9fdd94eb1.tar.gz rneovim-f08fd412829f001f7b8ef714a05780a9fdd94eb1.tar.bz2 rneovim-f08fd412829f001f7b8ef714a05780a9fdd94eb1.zip  | |
Merge pull request #4250 from jbradaric/vim-7.4.895
vim-patch:7.4.895
Diffstat (limited to 'src/nvim/ex_docmd.c')
| -rw-r--r-- | src/nvim/ex_docmd.c | 35 | 
1 files changed, 23 insertions, 12 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 13a298cc78..cc03dfaf19 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2679,16 +2679,25 @@ set_one_cmd_context (      p = cmd + 1;    } else {      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; -    /* for python 3.x: ":py3*" commands completion */ +    while (ASCII_ISALPHA(*p) || *p == '*') {  // Allow * wild card +      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') { -      ++p; -      while (ASCII_ISALPHA(*p) || *p == '*') -        ++p; +      p++; +      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); @@ -2702,9 +2711,11 @@ set_one_cmd_context (                (size_t)len) == 0)          break; -    if (cmd[0] >= 'A' && cmd[0] <= 'Z') -      while (ASCII_ISALNUM(*p) || *p == '*')            /* Allow * wild card */ -        ++p; +    if (cmd[0] >= 'A' && cmd[0] <= 'Z') { +      while (ASCII_ISALNUM(*p) || *p == '*') {  // Allow * wild card +        p++; +      } +    }    }    /*  | 
