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 vim/vim#6275,
            closes vim/vim#6258)
c8cb883015
This commit is contained in:
Jan Edmund Lazo
2020-12-26 19:35:13 -05:00
parent 0aa2c7e2ec
commit 684172ae82
2 changed files with 23 additions and 0 deletions

View File

@@ -3020,6 +3020,15 @@ const char * set_one_cmd_context(
arg = (const char *)skipwhite((const char_u *)arg);
}
// Skip over ++argopt argument
if ((ea.argt & ARGOPT) && *arg != NUL && strncmp(arg, "++", 2) == 0) {
p = arg;
while (*p && !ascii_isspace(*p)) {
MB_PTR_ADV(p);
}
arg = (const char *)skipwhite((const char_u *)p);
}
/*
* Check for '|' to separate commands and '"' to start comments.
* Don't do this for ":read !cmd" and ":write !cmd".

View File

@@ -955,5 +955,19 @@ 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 " vim: shiftwidth=2 sts=2 expandtab