diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-01-18 12:16:16 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-01-18 12:16:16 +0000 |
commit | 21669c0ed2dc9bd3f3bd52423b546a5d23326cc1 (patch) | |
tree | 5b13e3e6a5e2ef4bcaf5108e50d17428c723019c /src | |
parent | b3c7098365eadbb7be671361837435f370fe272e (diff) |
updated for version 7.1-233v7.1.233
Diffstat (limited to 'src')
-rw-r--r-- | src/ex_getln.c | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 547f1a17be..d43eb2a8f0 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4655,7 +4655,7 @@ expand_shellcmd(filepat, num_file, file, flagsarg) static void * call_user_expand_func __ARGS((void *(*user_expand_func) __ARGS((char_u *, int, char_u **, int)), expand_T *xp, int *num_file, char_u ***file)); /* - * call "user_expand_func()" to invoke a user defined VimL function and return + * Call "user_expand_func()" to invoke a user defined VimL function and return * the result (either a string or a List). */ static void * @@ -4677,11 +4677,22 @@ call_user_expand_func(user_expand_func, xp, num_file, file) *num_file = 0; *file = NULL; - keep = ccline.cmdbuff[ccline.cmdlen]; - ccline.cmdbuff[ccline.cmdlen] = 0; - sprintf((char *)num, "%d", ccline.cmdpos); + if (ccline.cmdbuff == NULL) + { + /* Completion from Insert mode, pass fake arguments. */ + keep = 0; + sprintf((char *)num, "%d", STRLEN(xp->xp_pattern)); + args[1] = xp->xp_pattern; + } + else + { + /* Completion on the command line, pass real arguments. */ + keep = ccline.cmdbuff[ccline.cmdlen]; + ccline.cmdbuff[ccline.cmdlen] = 0; + sprintf((char *)num, "%d", ccline.cmdpos); + args[1] = ccline.cmdbuff; + } args[0] = xp->xp_pattern; - args[1] = ccline.cmdbuff; args[2] = num; /* Save the cmdline, we don't know what the function may do. */ @@ -4694,8 +4705,8 @@ call_user_expand_func(user_expand_func, xp, num_file, file) ccline = save_ccline; current_SID = save_current_SID; - - ccline.cmdbuff[ccline.cmdlen] = keep; + if (ccline.cmdbuff != NULL) + ccline.cmdbuff[ccline.cmdlen] = keep; return ret; } diff --git a/src/version.c b/src/version.c index 2de2b36680..19b52f7385 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 233, +/**/ 232, /**/ 231, |