diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-05-24 10:46:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-05-24 10:46:45 +0200 |
commit | 2ff8b64679242e73248774a388d54931c9ce49bd (patch) | |
tree | 6426a325cea602f413999f1711a81804e9550d35 /src | |
parent | 06d2d38ab7564e1f784b1058a4ef4580cd6d1810 (diff) | |
download | vim-2ff8b64679242e73248774a388d54931c9ce49bd.zip |
patch 7.4.1833
Problem: Cannot use an Ex command for 'keywordprg'.
Solution: Accept an Ex command. (Nelo-Thara Wallus)
Diffstat (limited to 'src')
-rw-r--r-- | src/normal.c | 17 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/normal.c b/src/normal.c index 7c15c1552..d9948ec59 100644 --- a/src/normal.c +++ b/src/normal.c @@ -5485,10 +5485,12 @@ nv_ident(cmdarg_T *cap) { char_u *ptr = NULL; char_u *buf; + unsigned buflen; char_u *newbuf; char_u *p; char_u *kp; /* value of 'keywordprg' */ - int kp_help; /* 'keywordprg' is ":help" */ + int kp_help; /* 'keywordprg' is ":he" */ + int kp_ex; /* 'keywordprg' starts with ":" */ int n = 0; /* init for GCC */ int cmdchar; int g_cmd; /* "g" command */ @@ -5536,7 +5538,9 @@ nv_ident(cmdarg_T *cap) kp = (*curbuf->b_p_kp == NUL ? p_kp : curbuf->b_p_kp); kp_help = (*kp == NUL || STRCMP(kp, ":he") == 0 || STRCMP(kp, ":help") == 0); - buf = alloc((unsigned)(n * 2 + 30 + STRLEN(kp))); + kp_ex = (*kp == ':'); + buflen = (unsigned)(n * 2 + 30 + STRLEN(kp)); + buf = alloc(buflen); if (buf == NULL) return; buf[0] = NUL; @@ -5562,6 +5566,15 @@ nv_ident(cmdarg_T *cap) case 'K': if (kp_help) STRCPY(buf, "he! "); + else if (kp_ex) + { + if (cap->count0 != 0) + vim_snprintf((char *)buf, buflen, "%s %ld", + kp, cap->count0); + else + STRCPY(buf, kp); + STRCAT(buf, " "); + } else { /* An external command will probably use an argument starting diff --git a/src/version.c b/src/version.c index 863a58f19..eaa3e8ec9 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1833, +/**/ 1832, /**/ 1831, |