about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-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=()