diff options
Diffstat (limited to 'Completion/Base/Core')
| -rw-r--r-- | Completion/Base/Core/_description | 2 | ||||
| -rw-r--r-- | Completion/Base/Core/_main_complete | 16 | ||||
| -rw-r--r-- | Completion/Base/Core/_message | 28 |
3 files changed, 24 insertions, 22 deletions
diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description index 368b41ee2..586b1590d 100644 --- a/Completion/Base/Core/_description +++ b/Completion/Base/Core/_description @@ -86,7 +86,7 @@ elif [[ -n "$format" ]]; then [[ -n $match[3] ]] && argv+=( o:$match[3] ) fi - zformat -F format "$format" "d:$1" "${(@)argv[2,-1]}" + zformat -Fq format "$format" "d:$1" "${(@)argv[2,-1]}" fi if [[ -n "$gname" ]]; then diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete index 408a66ee3..b0c2db5b7 100644 --- a/Completion/Base/Core/_main_complete +++ b/Completion/Base/Core/_main_complete @@ -305,7 +305,7 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then elif [[ -n "$_menu_style[(r)select=long*]" ]]; then if [[ tmp -gt LINES ]]; then zmodload -i zsh/complist - MENUSELECT=00 + typeset -g MENUSELECT=00 fi fi if [[ "$MENUSELECT" != 00 ]]; then @@ -328,19 +328,19 @@ if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then done zmodload -i zsh/complist - MENUSELECT="$min" + typeset -g MENUSELECT="$min" else unset MENUSELECT fi fi if [[ -n "$MENUSELECT" ]]; then if [[ -n "$_menu_style[(r)interactive*]" ]]; then - MENUMODE=interactive + typeset -g MENUMODE=interactive elif [[ -n "$_menu_style[(r)search*]" ]]; then if [[ -n "$_menu_style[(r)*backward*]" ]]; then - MENUMODE=search-backward + typeset -g MENUMODE=search-backward else - MENUMODE=search-forward + typeset -g MENUMODE=search-forward fi else unset MENUMODE @@ -366,7 +366,7 @@ elif [[ nm -eq 0 && -z "$_comp_mesg" && esac _setup warnings - zformat -f mesg "$format" "d:$str" "D:${(F)${(@)_lastdescr:#}}" + zformat -fq mesg "$format" "d:$str" "D:${(F)${(@)_lastdescr:#}}" compadd -x "$mesg" fi @@ -385,12 +385,12 @@ fi # Stuff we always do to clean up. if [[ "$compstate[old_list]" = keep ]]; then if [[ $_saved_colors_set = 1 ]]; then - ZLS_COLORS="$_saved_colors" + typeset -g ZLS_COLORS="$_saved_colors" else unset ZLS_COLORS fi elif (( $#_comp_colors )); then - ZLS_COLORS="${(j.:.)_comp_colors}" + typeset -g ZLS_COLORS="${(j.:.)_comp_colors}" else unset ZLS_COLORS fi diff --git a/Completion/Base/Core/_message b/Completion/Base/Core/_message index dbeed4a88..8c3f351f6 100644 --- a/Completion/Base/Core/_message +++ b/Completion/Base/Core/_message @@ -1,19 +1,26 @@ #autoload -local format raw gopt +local format raw +local -a gopt +local -A opth -if [[ "$1" = -e ]]; then +zparseopts -A opth -D -F - \ + {1+,2+,V+:,J+:}=gopt F: M: n o: q s: S: x: X: \ + e r \ +|| return + +if (( $+opth[-e] )); then local expl ret=1 tag _comp_mesg=yes - if (( $# > 2 )); then - tag="$2" + if (( $# > 1 )); then + tag=$1 shift else tag="$curtag" fi - _tags "$tag" && while _next_label "$tag" expl "$2"; do + _tags "$tag" && while _next_label "$tag" expl "$1"; do compadd ${expl:/-X/-x} ret=0 done @@ -24,22 +31,17 @@ if [[ "$1" = -e ]]; then return ret fi -gopt=() -zparseopts -D -a gopt 1 2 V J - _tags messages || return 1 -if [[ "$1" = -r ]]; then - raw=yes - shift - format="$1" +if (( $+opth[-r] )); then + raw=yes format=$1 else zstyle -s ":completion:${curcontext}:messages" format format || zstyle -s ":completion:${curcontext}:descriptions" format format fi if [[ -n "$format$raw" ]]; then - [[ -z "$raw" ]] && zformat -F format "$format" "d:$1" "${(@)argv[2,-1]}" + [[ -z "$raw" ]] && zformat -Fq format "$format" "d:$1" "${(@)argv[2,-1]}" builtin compadd "$gopt[@]" -x "$format" _comp_mesg=yes fi |
