forked from aniani/vim
patch 8.2.1121: command completion not working after ++arg
Problem: Command completion not working after ++arg. Solution: Move skipping up. (Christian Brabandt, closes #6382)
This commit is contained in:
parent
92fdd1e75d
commit
743d062020
@ -1099,6 +1099,15 @@ set_one_cmd_context(
|
||||
|
||||
arg = skipwhite(p);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update)
|
||||
{
|
||||
if (*arg == '>') // append
|
||||
@ -1146,14 +1155,6 @@ 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".
|
||||
|
@ -1593,8 +1593,11 @@ func Test_read_shellcmd()
|
||||
call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||
call assert_notmatch('^"r!.*\<runtest.vim\>', @:)
|
||||
call assert_match('^"r!.*\<rm\>', @:)
|
||||
|
||||
call feedkeys(":r ++enc=utf-8 !rm\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||
call assert_notmatch('^"r.*\<runtest.vim\>', @:)
|
||||
call assert_match('^"r ++enc\S\+ !.*\<rm\>', @:)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1121,
|
||||
/**/
|
||||
1120,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user