about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Base/_arguments9
-rw-r--r--Src/Zle/computil.c12
2 files changed, 15 insertions, 6 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 5f3d83a20..43f5bb878 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -24,7 +24,7 @@ if (( long )); then
   name="${name//[^a-zA-Z0-9_]/_}"
 
   if (( ! ${(P)+name} )); then
-    local iopts sopts pattern tmpo cur opt cache
+    local iopts sopts pattern tmpo cur cache
     typeset -U lopts
 
     cache=()
@@ -287,8 +287,7 @@ if comparguments -i "$autod" "$@"; then
         fi
       fi
       if [[ -n "$opts" && -z "$aret$matched" &&
-            nm -ne compstate[nmatches] ]] &&
-          _requested arguments; then
+            nm -eq compstate[nmatches] ]]; then
 
         local prefix suffix
 
@@ -303,8 +302,10 @@ if comparguments -i "$autod" "$@"; then
 	  SUFFIX="$suffix"
 	  IPREFIX="${IPREFIX}${equal[1]%%:*}="
 	  matched=yes
-	  comparguments -L "$equal[1]" descr action subc
+
+	  comparguments -L "${equal[1]%%:*}" descr action subc
 	  curcontext="${oldcontext}:$subc"
+
 	  continue
         fi
       fi
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 83c6b8131..cc20c8e6a 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2730,8 +2730,16 @@ bin_comptry(char *nam, char **args, char *ops, int func)
 	args = arrdup(args);
 
 	for (p = q = args, all = comptags[lasttaglevel]->all; *p; p++)
-	    if (arrcontains(all, *p))
-		*q++ = *p;
+	    if (arrcontains(all, *p)) {
+		Ctset s;
+
+		for (s = comptags[lasttaglevel]->sets; s; s = s->next)
+		    if (arrcontains(s->tags, *p))
+			break;
+
+		if (!s)
+		    *q++ = *p;
+	    }
 	*q = NULL;
 
 	if (*args) {