# HG changeset patch # User Bram Moolenaar # Date 1592507703 -7200 # Node ID b4835adf384e34bc3f82b9b605a1c22a098dd749 # Parent fe3d963627faad2788cca1c817824a0d21b99b5b patch 8.2.1007: completion doesn't work after ":r ++arg !" Commit: https://github.com/vim/vim/commit/c8cb883015619cfe6db931ac2d6e15b0be5c56ed Author: Bram Moolenaar Date: Thu Jun 18 21:14:30 2020 +0200 patch 8.2.1007: completion doesn't work after ":r ++arg !" Problem: Completion doesn't work after ":r ++arg !". Solution: Skip over "++arg". (Christian Brabandt, closes https://github.com/vim/vim/issues/6275, closes #6258) diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -1146,6 +1146,15 @@ set_one_cmd_context( arg = skipwhite(arg); } + // Skip over ++argopt argument + if ((ea.argt & EX_ARGOPT) && *arg != NUL && STRNCMP(arg, "++", 2) == 0) + { + p = arg; + while (*p && !vim_isspace(*p)) + MB_PTR_ADV(p); + arg = skipwhite(p); + } + // Check for '|' to separate commands and '"' to start comments. // Don't do this for ":read !cmd" and ":write !cmd". if ((ea.argt & EX_TRLBAR) && !usefilter) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1568,5 +1568,20 @@ func Test_zero_line_search() q! endfunc +func Test_read_shellcmd() + CheckUnix + if executable('ls') + " There should be ls in the $PATH + call feedkeys(":r! l\\\"\", 'tx') + call assert_match('^"r! .*\', @:) + endif + + if executable('rm') + call feedkeys(":r! ++enc=utf-8 r\\\"\", 'tx') + call assert_notmatch('^"r!.*\', @:) + call assert_match('^"r!.*\', @:) + endif +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1007, +/**/ 1006, /**/ 1005,