about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-09-03 11:12:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-09-03 11:12:15 +0000
commitd3891edfca77ce587585990135242247a48595fc (patch)
tree061a77d2a9a70b5d8a34c7894ead1e5a1d393931 /Completion/Base
parent260b433632310e847b5c540f2812cc0856576273 (diff)
downloadzsh-d3891edfca77ce587585990135242247a48595fc.tar.gz
zsh-d3891edfca77ce587585990135242247a48595fc.tar.xz
zsh-d3891edfca77ce587585990135242247a48595fc.zip
users/12713: returning REPLY to _user_expand sets description for expansion
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Completer/_user_expand13
1 files changed, 7 insertions, 6 deletions
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