diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2013-11-07 14:52:31 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2013-11-07 14:52:31 +0100 |
commit | d799ac78a744a5359563af55b4dee9e91255a1dc (patch) | |
tree | 73475ed7089e6ee050085a96b88018994b43bdfc /Completion/Base/Widget/_complete_help | |
parent | abfb3b136a4ad5b2832fb7d920442a2bb28c0697 (diff) | |
parent | 375115c7dfd6dff576915d25fe2ecdd381dd9d81 (diff) | |
download | zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.tar.gz zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Base/Widget/_complete_help')
-rw-r--r-- | Completion/Base/Widget/_complete_help | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/Completion/Base/Widget/_complete_help b/Completion/Base/Widget/_complete_help index 99f2f2dba..0563c618f 100644 --- a/Completion/Base/Widget/_complete_help +++ b/Completion/Base/Widget/_complete_help @@ -6,41 +6,41 @@ _complete_help() { local _sort_tags=_help_sort_tags text i j k tmp typeset -A help_funcs help_tags help_sfuncs help_styles - compadd() { return 1 } - zstyle() { - local _f="${${(@)${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(dispatch|wanted|requested|all_labels|next_label)}% *}" - - [[ -z "$_f" ]] && _f="${${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(dispatch|wanted|requested|all_labels|next_label)}" - - if [[ "$help_sfuncs[$2]" != *${_f}* || - "$help_styles[${2}${_f}]" != *${3}* ]]; then - - [[ "$help_sfuncs[$2]" != *${_f}* ]] && help_sfuncs[$2]+=$'\0'"${_f}" - local _t - - case "$1" in - -s) _t='[string] ';; - -a) _t='[array] ';; - -h) _t='[assoc] ';; - *) _t='[boolean]';; - esac - help_styles[${2}${_f}]+=",${_t} ${3}:${_f}" - fi - - # No need to call the completers more than once with different match specs. - - if [[ "$3" = matcher-list ]]; then - set -A "$4" '' - else - builtin zstyle "$@" - fi + { + compadd() { return 1 } + zstyle() { + local _f="${${(@)${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(dispatch|wanted|requested|all_labels|next_label)}% *}" + + [[ -z "$_f" ]] && _f="${${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(dispatch|wanted|requested|all_labels|next_label)}" + + if [[ "$help_sfuncs[$2]" != *${_f}* || + "$help_styles[${2}${_f}]" != *${3}* ]]; then + + [[ "$help_sfuncs[$2]" != *${_f}* ]] && help_sfuncs[$2]+=$'\0'"${_f}" + local _t + + case "$1" in + -s) _t='[string] ';; + -a) _t='[array] ';; + -h) _t='[assoc] ';; + *) _t='[boolean]';; + esac + help_styles[${2}${_f}]+=",${_t} ${3}:${_f}" + fi + + # No need to call the completers more than once with different match specs. + + if [[ "$3" = matcher-list ]]; then + set -A "$4" '' + else + builtin zstyle "$@" + fi + } + + ${1:-_main_complete} + } always { + unfunction compadd zstyle } - trap 'unfunction compadd zstyle' EXIT INT - - ${1:-_main_complete} - - unfunction compadd zstyle - trap - EXIT INT for i in "${(@ok)help_funcs}"; do text+=$'\n'"tags in context :completion:${i}:" @@ -73,7 +73,7 @@ _complete_help() { } _help_sort_tags() { - local f="${${(@)${(@)funcstack[3,(i)_(main_complete|complete|approximate|normal)]}:#_(dispatch|wanted|requested|all_labels|next_label)}% *}" + local f="${${(@)${(@)funcstack[3,(i)_(main_complete|complete|approximate|normal)]}:#(_(dispatch|wanted|requested|all_labels|next_label)|\(eval\))}% *}" if [[ "$help_funcs[$curcontext]" != *${f}* || "$help_tags[${curcontext}${f}]" != *(${(j:|:)~argv})* ]]; then |