diff src/cmdexpand.c @ 21140:f86140ad0164 v8.2.1121

patch 8.2.1121: command completion not working after ++arg Commit: https://github.com/vim/vim/commit/743d0620203388bf87dc611cea544b485e4b9f85 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 3 18:15:06 2020 +0200 patch 8.2.1121: command completion not working after ++arg Problem: Command completion not working after ++arg. Solution: Move skipping up. (Christian Brabandt, closes https://github.com/vim/vim/issues/6382)
author Bram Moolenaar <Bram@vim.org>
date Fri, 03 Jul 2020 18:30:03 +0200
parents b4835adf384e
children 5db63c2c6929
line wrap: on
line diff
--- 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".