From 3b34c992bc51bb065ca59f1f4903a4315f3d2e30 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 13 Feb 2016 12:54:47 +0100 Subject: vim-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) https://github.com/vim/vim/commit/23d1b62746dce048c80cc19e7e5af1d513b6b4cf --- src/nvim/ex_docmd.c | 18 +++++++++++++----- src/nvim/version.c | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index dfae2b849d..11338424f3 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2679,17 +2679,25 @@ set_one_cmd_context ( p = cmd + 1; } else { p = cmd; - while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */ + 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 */ + } + // 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; } + // check for non-alpha command + if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) { + ++p; + } len = (int)(p - cmd); if (len == 0) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 4de63ebb10..499ad4c3b4 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -393,7 +393,7 @@ static int included_patches[] = { 898, // 897 NA // 896, - // 895, + 895, // 894 NA // 893, // 892, -- cgit