mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
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 vim/vim#6382)
743d062020
This commit is contained in:
@@ -2979,6 +2979,15 @@ const char * set_one_cmd_context(
|
|||||||
|
|
||||||
const char *arg = (const char *)skipwhite((const char_u *)p);
|
const char *arg = (const char *)skipwhite((const char_u *)p);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) {
|
if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) {
|
||||||
if (*arg == '>') { // Append.
|
if (*arg == '>') { // Append.
|
||||||
if (*++arg == '>') {
|
if (*++arg == '>') {
|
||||||
@@ -3020,15 +3029,6 @@ const char * set_one_cmd_context(
|
|||||||
arg = (const char *)skipwhite((const char_u *)arg);
|
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.
|
* Check for '|' to separate commands and '"' to start comments.
|
||||||
* Don't do this for ":read !cmd" and ":write !cmd".
|
* Don't do this for ":read !cmd" and ":write !cmd".
|
||||||
|
@@ -967,6 +967,10 @@ func Test_read_shellcmd()
|
|||||||
call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx')
|
call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||||
call assert_notmatch('^"r!.*\<runtest.vim\>', @:)
|
call assert_notmatch('^"r!.*\<runtest.vim\>', @:)
|
||||||
call assert_match('^"r!.*\<rm\>', @:)
|
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
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user