about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Completer/_complete10
-rw-r--r--Completion/Base/Core/_normal6
-rw-r--r--Completion/Base/Utility/_contexts10
3 files changed, 16 insertions, 10 deletions
diff --git a/Completion/Base/Completer/_complete b/Completion/Base/Completer/_complete
index 28bb008ca..98d293175 100644
--- a/Completion/Base/Completer/_complete
+++ b/Completion/Base/Completer/_complete
@@ -85,7 +85,7 @@ if [[ -n "$compcontext" ]]; then
     ccarray[3]="$compcontext"
 
     comp="$_comps[$compcontext]"
-    [[ -z "$comp" ]] || "$comp"
+    [[ -n "$comp" ]] && eval "$comp"
   fi
 
   return
@@ -94,10 +94,10 @@ fi
 # An entry for `-first-' is the replacement for `compctl -T'
 
 comp="$_comps[-first-]"
-if [[ ! -z "$comp" ]]; then
+if [[ -n "$comp" ]]; then
   service="${_services[-first-]:--first-}"
   ccarray[3]=-first-
-  "$comp" && ret=0
+  eval "$comp" && ret=0
   if [[ "$_compskip" = all ]]; then
     _compskip=
     return ret
@@ -135,8 +135,8 @@ else
     fi
     comp="$_comps[-default-]"
   fi
-  [[ -z "$comp" ]] ||
-      service="${_services[-default-]:--default-}" && "$comp" && ret=0
+  [[ -n "$comp" ]] &&
+      service="${_services[-default-]:--default-}" && eval "$comp" && ret=0
 fi
 
 _compskip=
diff --git a/Completion/Base/Core/_normal b/Completion/Base/Core/_normal
index 364a56764..9ddfab1cd 100644
--- a/Completion/Base/Core/_normal
+++ b/Completion/Base/Core/_normal
@@ -19,7 +19,7 @@ if [[ CURRENT -eq 1 ]]; then
   curcontext="${curcontext%:*:*}:-command-:"
 
   comp="$_comps[-command-]"
-  [[ -z "$comp" ]] || "$comp" && ret=0
+  [[ -n "$comp" ]] && eval "$comp" && ret=0
 
   return ret
 else
@@ -86,7 +86,7 @@ service="${_services[$cmd1]:-$cmd1}"
 
 if [[ -n "$comp" ]]; then
   _compskip=patterns
-  "$comp" && ret=0
+  eval "$comp" && ret=0
   [[ "$_compskip" = (all|*patterns*) ]] && return ret
 elif [[ "$_compskip" != *default* ]]; then
   name=-default-
@@ -121,7 +121,7 @@ if [[ "$_compskip" != (all|*patterns*) ]]; then
 fi
 
 [[ "$name" = -default- && -n "$comp" && "$_compskip" != (all|*default*) ]] &&
-  service="${_services[-default-]:--default-}" && "$comp" && ret=0
+  service="${_services[-default-]:--default-}" && eval "$comp" && ret=0
 
 _compskip=''
 
diff --git a/Completion/Base/Utility/_contexts b/Completion/Base/Utility/_contexts
index 680f2019f..f0e5ba874 100644
--- a/Completion/Base/Utility/_contexts
+++ b/Completion/Base/Utility/_contexts
@@ -7,11 +7,17 @@
 # `_contexts -math-' to get the completions that would be generated for a
 # mathematical context.
 
-local i tmp ret=1 service
+local i tmp ret=1 service or
+
+if [[ $1 = -o ]]; then
+  or=yes
+  shift
+fi
 
 for i; do
   tmp="$_comps[$i]"
-  [[ -z "$tmp" ]] || service="${_services[$i]:-$i}" && "$tmp" && ret=0
+  [[ -n "$tmp" ]] && service="${_services[$i]:-$i}" && eval "$tmp" && ret=0
+  [[ -n "$or" && ret -eq 0 ]] && return 0
 done
 
 return ret