]> granicus.if.org Git - vim/commitdiff
patch 8.2.1121: command completion not working after ++arg v8.2.1121
authorBram Moolenaar <Bram@vim.org>
Fri, 3 Jul 2020 16:15:06 +0000 (18:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 3 Jul 2020 16:15:06 +0000 (18:15 +0200)
Problem:    Command completion not working after ++arg.
Solution:   Move skipping up. (Christian Brabandt, closes #6382)

src/cmdexpand.c
src/testdir/test_cmdline.vim
src/version.c

index 63f0cc7b152e82483e6e5a8770505971c0e005a1..d92366c61e75b5d07e6132cf83cd2195a05e760b 100644 (file)
@@ -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".
index 2a3112a73452900798df72f2c912990c9f30a116..eb213f1976c7c340436d3f3401a047944e808750 100644 (file)
@@ -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
index c13c6e64d1a2af5dab213e7b74666954105c1434..de98479adb477cd64898168bc6a9e42da563c973 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1121,
 /**/
     1120,
 /**/