about summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 0028ac1ca..ecfa2bc34 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2167,9 +2167,11 @@ ca_parse_line(Cadef d, int multi, int first)
 #endif
 		   )
 	    return 1;
-	else if (state.arg && (!napat || !pattry(napat, line))) {
+	else if (state.arg &&
+		 (!napat || cur <= compcurrent || !pattry(napat, line))) {
 	    /* Otherwise it's a normal argument. */
-	    if (napat && ca_inactive(d, NULL, cur + 1, 1, NULL))
+	    if (napat && cur <= compcurrent &&
+		    ca_inactive(d, NULL, cur + 1, 1, NULL))
 		return 1;
 
 	    arglast = 1;