Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Two missing completion functions that bug me
- X-seq: zsh-workers 13849
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Two missing completion functions that bug me
- Date: Fri, 30 Mar 2001 10:23:15 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Fri, 30 Mar 2001 10:21:08 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
I wrote:
> ...
>
> You could try the patch below ...
Ahem.
Bye
Sven
Index: Completion/Base/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_arguments,v
retrieving revision 1.34
diff -u -r1.34 _arguments
--- Completion/Base/_arguments 2001/03/28 09:50:38 1.34
+++ Completion/Base/_arguments 2001/03/30 08:22:57
@@ -335,14 +335,16 @@
if [[ "$single" = direct ]]; then
_all_labels options expl option \
compadd -QS '' - "${PREFIX}${SUFFIX}"
- elif [[ "$single" = next ]]; then
- _all_labels options expl option \
- compadd -Q - "${PREFIX}${SUFFIX}"
elif [[ "$single" = equal ]]; then
_all_labels options expl option \
compadd -QqS= - "${PREFIX}${SUFFIX}"
else
+
tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
+
+ [[ "$single" = next ]] &&
+ tmp1=( "${(@)tmp1:#[-+]${PREFIX[-1]}((#e)|:*)}" )
+
[[ "$PREFIX" != --* ]] && tmp1=( "${(@)tmp1:#--*}" )
tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )
tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
@@ -351,6 +353,11 @@
_describe -o option \
tmp1 tmp2 -Q -S '' -- \
tmp3 -Q
+
+ [[ "$single" = next && nm -eq $compstate[nmatches] ]] &&
+ _all_labels options expl option \
+ compadd -Q - "${PREFIX}${SUFFIX}"
+
fi
single=yes
else
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author