Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Silly questions about _arguments & Co (and probably bugs)
- X-seq: zsh-workers 7801
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Silly questions about _arguments & Co (and probably bugs)
- Date: Mon, 13 Sep 1999 13:56:58 +0200 (MET DST)
- In-reply-to: Tanaka Akira's message of 10 Sep 1999 00:44:34 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> I think `compconf option_prefix=all' is useful.
(Btw, the value of option_prefix isn't used any more -- only whether
it's empty or not.)
> And, I found another problem. `patch -f<TAB>' does not show list of
> completion candidates. However completion itself works well.
>
> ...
>
> So, I think this is the problem of `_display'.
Almost. There were two problems: with single-letter options
PREFIX/SUFFIX weren't cleared before `_display' was called (so that
(almost) no option matched) and the return value of `_display' wasn't
used to find out that `_arguments' should create the list itself.
Bye
Sven
diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments Mon Sep 13 13:13:10 1999
+++ Completion/Base/_arguments Mon Sep 13 13:51:43 1999
@@ -822,12 +822,17 @@
if [[ -n "$sopts" && -n "$PREFIX" &&
"$PREFIX" = [-+]${~soptseq}[$sopts] ]]; then
if [[ "$PREFIX" = [-+]${~soptseq1} ]]; then
- if [[ -n "$compconfig[describe_options]" &&
- "$compconfig[describe_options]" != *\!${cmd}* ]]; then
- _display tmp odescr
- else
- tmp="( ${(j: :)${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=} )"
+ local dpre="$PREFIX" dsuf="$SUFFIX"
+
+ PREFIX=''
+ SUFFIX=''
+ if [[ -z "$compconfig[describe_options]" ||
+ "$compconfig[describe_options]" = *\!${cmd}* ]] ||
+ ! _display tmp odescr; then
+ tmp=( "${dpre[1]}${(@o)^${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=}" )
fi
+ PREFIX="$dpre"
+ SUFFIX="$dsuf"
compadd "$expl[@]" -Q -M 'r:|[_-]=* r:|=*' -y tmp - \
"${PREFIX}${(@k)^opts[(I)${PREFIX[1]}?]#?}" \
"${PREFIX}${(@k)^dopts[(I)${PREFIX[1]}?]#?}" \
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author