about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-02-27 20:44:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-02-27 20:44:00 +0000
commitc8d1071cd8ca5c92e7d75b5dda2be529da6755bd (patch)
tree44ba8ded6a0fe172fc2e910309c4d35e989be300 /Completion/Base
parentfb25ce0e4dda89ee654c4be2a87eb2c9517fc140 (diff)
downloadzsh-c8d1071cd8ca5c92e7d75b5dda2be529da6755bd.tar.gz
zsh-c8d1071cd8ca5c92e7d75b5dda2be529da6755bd.tar.xz
zsh-c8d1071cd8ca5c92e7d75b5dda2be529da6755bd.zip
23198: improve _values -s
unposted: document _regex_words -t
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Utility/_regex_words5
-rw-r--r--Completion/Base/Utility/_values2
2 files changed, 3 insertions, 4 deletions
diff --git a/Completion/Base/Utility/_regex_words b/Completion/Base/Utility/_regex_words
index 1cc9e9ccc..77ba197a4 100644
--- a/Completion/Base/Utility/_regex_words
+++ b/Completion/Base/Utility/_regex_words
@@ -31,9 +31,8 @@ for (( i = 1; i <= $#; i++ )); do
   if [[ $term = $'\0' ]]; then
     reply+=(":${tag}:${desc}:(( ${wds[1]//\*}:${wds[2]//(#m)[: \(\)]/\\$MATCH} ))")
   else
-    # HERE: we should add the terminator instead of a space, but
-    # there doesn't appear to be an easy way of doing that.
-    reply+=(":${tag}:${desc}:(( ${wds[1]//\*}${term//(#m)[: \(\)]/\\$MATCH}:${wds[2]//(#m)[: \(\)]/\\$MATCH} ))")
+    reply+=(":${tag}:${desc}:_values -s ${(q)term} ${(q)desc} \
+${(q)${${wds[1]//\*}//(#m)[:\[\]]/\\$MATCH}}\\[${(q)${wds[2]//(#m)[:\[\]]/\\$MATCH}}\\]")
   fi
   eval "reply+=($wds[3])"
   if (( $i == $# )); then
diff --git a/Completion/Base/Utility/_values b/Completion/Base/Utility/_values
index 5cfa4bd30..52c42bc70 100644
--- a/Completion/Base/Utility/_values
+++ b/Completion/Base/Utility/_values
@@ -50,7 +50,7 @@ if compvalues -i "$@"; then
       fi
     else
       compvalues -d descr
-      if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then
+      if compvalues -s sep; then
         sep=( "-qS" "$sep" )
       else
         sep=()