mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
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:
@@ -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".
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user