diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-20 23:11:33 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-20 23:11:33 +0200 |
commit | 20d89e0ac65686481f97657008deede0b39ef5db (patch) | |
tree | 5e4b7cec2362f013dd0f35fbb40ca569644cc06f | |
parent | e9f9f16387554e5b34ba42ce00c42c28dd66af58 (diff) | |
download | vim-git-20d89e0ac65686481f97657008deede0b39ef5db.tar.gz |
patch 8.2.1873: Vim9: missing white space when using <f-args>v8.2.1873
Problem: Vim9: missing white space when using <f-args>.
Solution: Add spaces. (Christian J. Robinson)
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 18 | ||||
-rw-r--r-- | src/usercmd.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 599c287e2..ad3454d83 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -375,6 +375,24 @@ def Test_command_star_range() bwipe! enddef +def Test_f_args() + var lines =<< trim END + vim9script + + func SaveCmdArgs(...) + let g:args = a:000 + endfunc + + command -nargs=* TestFArgs call SaveCmdArgs(<f-args>) + + TestFArgs + assert_equal([], g:args) + + TestFArgs one two three + assert_equal(['one', 'two', 'three'], g:args) + END + CheckScriptSuccess(lines) +enddef " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/usercmd.c b/src/usercmd.c index de49d4199..261a62920 100644 --- a/src/usercmd.c +++ b/src/usercmd.c @@ -1153,7 +1153,7 @@ uc_split_args(char_u *arg, size_t *lenp) p = skipwhite(p); if (*p == NUL) break; - len += 3; // "," + len += 4; // ", " } else { @@ -1199,6 +1199,7 @@ uc_split_args(char_u *arg, size_t *lenp) break; *q++ = '"'; *q++ = ','; + *q++ = ' '; *q++ = '"'; } else diff --git a/src/version.c b/src/version.c index dd3435666..08da9925c 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1873, +/**/ 1872, /**/ 1871, |