about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Core/_description24
1 files changed, 16 insertions, 8 deletions
diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index 573bfbc3d..593369a0a 100644
--- a/Completion/Base/Core/_description
+++ b/Completion/Base/Core/_description
@@ -58,7 +58,9 @@ if [[ -z "$_comp_no_ignore" ]]; then
 				  "${(@)words[CURRENT+1,-1]}" );;
     esac
 
-  (( $#_comp_ignore )) && opts=( $opts -F _comp_ignore )
+  # Ensure the ignore option is first so we can override it
+  # for fake-always.
+  (( $#_comp_ignore )) && opts=( -F _comp_ignore $opts )
 else
   _comp_ignore=()
 fi
@@ -86,15 +88,21 @@ else
   fi
 fi
 
-if ! (( ${funcstack[2,-1][(I)_description]} )) &&
-   zstyle -a ":completion:${curcontext}:$tag" fake match; then
+if ! (( ${funcstack[2,-1][(I)_description]} )); then
+  local fakestyle descr
+  for fakestyle in fake fake-always; do
+    zstyle -a ":completion:${curcontext}:$tag" $fakestyle match ||
+    continue
 
-  local descr
+    descr=( "${(@M)match:#*[^\\]:*}" )
 
-  descr=( "${(@M)match:#*[^\\]:*}" )
-
-  compadd "${(@P)name}" - "${(@)${(@)match:#*[^\\]:*}:s/\\:/:/}"
-  (( $#descr )) && _describe -t "$tag" '' descr "${(@P)name}"
+    opts=("${(@P)name}")
+    if [[ $fakestyle = fake-always && $opts[1,2] = "-F _comp_ignore" ]]; then
+      shift 2 opts
+    fi
+    compadd "${(@)opts}" - "${(@)${(@)match:#*[^\\]:*}:s/\\:/:/}"
+    (( $#descr )) && _describe -t "$tag" '' descr "${(@)opts}"
+  done
 fi
 
 return 0