1
0
forked from aniani/vim

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 #6275,
            closes #6258)
This commit is contained in:
Bram Moolenaar
2020-06-18 21:14:30 +02:00
parent efd8855594
commit c8cb883015
3 changed files with 26 additions and 0 deletions

View File

@@ -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)

View File

@@ -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\<c-a>\<c-b>\"\<cr>", 'tx')
call assert_match('^"r! .*\<ls\>', @:)
endif
if executable('rm')
call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx')
call assert_notmatch('^"r!.*\<runtest.vim\>', @:)
call assert_match('^"r!.*\<rm\>', @:)
endif
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1007,
/**/
1006,
/**/