summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-15 16:27:14 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-15 16:27:14 +0000
commit181e491debe6987763df81b9dd081213b88a43e2 (patch)
tree7a6786e757fccbf5c2ebd5cf9e1342f121033664 /Completion
parente12c3e2dc96391ecbbb22b484dc919a3f1a5500e (diff)
downloadzsh-181e491debe6987763df81b9dd081213b88a43e2.tar.gz
zsh-181e491debe6987763df81b9dd081213b88a43e2.zip
users/10989: add fake-always pattern that overrides ignored-patterns
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