summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-03 18:15:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-03 18:15:06 +0200
commit743d0620203388bf87dc611cea544b485e4b9f85 (patch)
treef8e539f3b4292a86c5b33797438bc0db09f6eff7
parent92fdd1e75db3048516a93a18cc53ed984813c9e5 (diff)
patch 8.2.1121: command completion not working after ++argv8.2.1121
Problem: Command completion not working after ++arg. Solution: Move skipping up. (Christian Brabandt, closes #6382)
-rw-r--r--src/cmdexpand.c17
-rw-r--r--src/testdir/test_cmdline.vim5
-rw-r--r--src/version.c2
3 files changed, 15 insertions, 9 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 63f0cc7b15..d92366c61e 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -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".
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 2a3112a734..eb213f1976 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index c13c6e64d1..de98479adb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1121,
+/**/
1120,
/**/
1119,