From 181e491debe6987763df81b9dd081213b88a43e2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 15 Nov 2006 16:27:14 +0000 Subject: users/10989: add fake-always pattern that overrides ignored-patterns --- Completion/Base/Core/_description | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'Completion/Base') 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 -- cgit 1.4.1