From d3891edfca77ce587585990135242247a48595fc Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 3 Sep 2012 11:12:15 +0000 Subject: users/12713: returning REPLY to _user_expand sets description for expansion --- Completion/Base/Completer/_user_expand | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/Completer/_user_expand b/Completion/Base/Completer/_user_expand index 049cc31ef..cf3d172f0 100644 --- a/Completion/Base/Completer/_user_expand +++ b/Completion/Base/Completer/_user_expand @@ -12,7 +12,7 @@ setopt localoptions nonomatch [[ _matcher_num -gt 1 ]] && return 1 -local exp word sort expr expl subd suf=" " asp tmp spec +local exp word sort expr expl subd suf=" " asp tmp spec REPLY local -a specs reply if [[ "$funcstack[2]" = _prefix ]]; then @@ -30,6 +30,7 @@ exp=("$word") zstyle -a ":completion:${curcontext}" user-expand specs || return 1 for spec in $specs; do + REPLY= case $spec in ('$'[[:IDENT:]]##) # Spec is an associative array with explicit keys. @@ -85,9 +86,9 @@ fi if [[ -z "$compstate[insert]" ]] ;then if [[ "$sort" = menu ]]; then - _description expansions expl expansions "o:$word" + _description expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" else - _description -V expansions expl expansions "o:$word" + _description -V expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" fi compadd "$expl[@]" -UQ -qS "$suf" -a exp @@ -98,9 +99,9 @@ else local i j normal space dir if [[ "$sort" = menu ]]; then - _description expansions expl expansions "o:$word" + _description expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" else - _description -V expansions expl expansions "o:$word" + _description -V expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" fi normal=() space=() @@ -120,7 +121,7 @@ else (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal fi - if _requested all-expansions expl 'all expansions'; then + if _requested all-expansions expl "all expansions${REPLY:+: $REPLY}"; then local disp dstr if [[ "${#${exp}}" -ge COLUMNS ]]; then -- cgit 1.4.1