Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in _describe
- X-seq: zsh-workers 16085
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: bug in _describe
- Date: Fri, 19 Oct 2001 12:25:13 +0200
- In-reply-to: <3BCDCEF1.C103658D@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3BCDCEF1.C103658D@xxxxxxxxxxx>
Oliver Kiddle wrote:
> Completion of conditions no longer works:
>
> % [[ -<tab>
> (eval):1: error in flags
>
> I'm fairly certain that this was introduced in 15415. Error comes from
> line 57 of _describe. It is not accounting for arrays specified as '(
> ... )' instead of actual array names.
Ahem. Indeed. I forgot to handle the case where the matches are given
with `(...)', not via an array name. Sorry.
The patch also makes _condition use _file_descriptors for completion
after -t and it keeps _file_descriptors from displaying empty
descriptions.
Bye
Sven
Index: Completion/Base/Utility/_describe
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_describe,v
retrieving revision 1.9
diff -u -r1.9 _describe
--- Completion/Base/Utility/_describe 2001/08/07 10:38:36 1.9
+++ Completion/Base/Utility/_describe 2001/10/19 10:24:45
@@ -54,7 +54,11 @@
while (( $# )); do
_strs="_a_$_try$_i"
- eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+ if [[ "$1" = \(*\) ]]; then
+ eval local "_a_$_try$_i;_a_$_try$_i"'='$1
+ else
+ eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+ fi
_argv[_i]="_a_$_try$_i"
shift
(( _i++ ))
@@ -63,7 +67,11 @@
_mats=
else
_matss="_a_$_try$_i"
- eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+ if [[ "$1" = \(*\) ]]; then
+ eval local "_a_$_try$_i;_a_$_try$_i"'='$1
+ else
+ eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+ fi
_argv[_i]="_a_$_try$_i"
shift
(( _i++ ))
Index: Completion/Zsh/Context/_condition
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_condition,v
retrieving revision 1.1
diff -u -r1.1 _condition
--- Completion/Zsh/Context/_condition 2001/04/02 11:22:21 1.1
+++ Completion/Zsh/Context/_condition 2001/10/19 10:24:45
@@ -6,6 +6,8 @@
_tags -C -o options && _options
elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then
_tags -C "$prev" files && _files
+elif [[ "$prev" = -t ]]; then
+ _file_descriptors
else
if [[ "$PREFIX" = -* ]] ||
! zstyle -T ":completion:${curcontext}:options" prefix-needed; then
Index: Completion/Zsh/Type/_file_descriptors
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v
retrieving revision 1.2
diff -u -r1.2 _file_descriptors
--- Completion/Zsh/Type/_file_descriptors 2001/07/25 12:36:34 1.2
+++ Completion/Zsh/Type/_file_descriptors 2001/10/19 10:24:45
@@ -19,7 +19,11 @@
list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
done
fi
- _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
-else
- _wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds
+
+ if (( $list[(I)* $sep ?*] )); then
+ _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
+ return
+ fi
fi
+
+_wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author