From c8d1071cd8ca5c92e7d75b5dda2be529da6755bd Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 27 Feb 2007 20:44:00 +0000 Subject: 23198: improve _values -s unposted: document _regex_words -t --- Completion/Base/Utility/_regex_words | 5 ++--- Completion/Base/Utility/_values | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'Completion') 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=() -- cgit 1.4.1