Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: pws-21: _vars
- X-seq: zsh-workers 6568
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: pws-21: _vars
- Date: Thu, 10 Jun 1999 13:07:05 +0200 (MET DST)
- In-reply-to: Peter Stephenson's message of Thu, 10 Jun 1999 12:22:54 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> This extends the _vars completion, used after things like read and vared,
> to allow completion of the keys of associative arrays.
% typeset -A foo
% foo=(-bar baz)
% vared 'foo[<TAB>
compadd: bad option -b
I often forget to add the `-' before the words in compadd, too.
This also had a problem when there were characters after the `['.
Bye
Sven
--- oc/Base/_vars Thu Jun 10 13:00:40 1999
+++ Completion/Base/_vars Thu Jun 10 13:03:38 1999
@@ -4,7 +4,7 @@
# `vared compconfig[<TAB>'. However, in this version the [ must be
# added by hand.
-if [[ $PREFIX = *\[ ]]; then
+if [[ $PREFIX = *\[* ]]; then
local var=${PREFIX%%\[*}
local elt="${PREFIX#*\]}${SUFFIX%\]}"
local addclose
@@ -13,7 +13,7 @@
addclose=(-S ']')
fi
if [[ ${(tP)var} = assoc* ]]; then
- compadd $addclose ${(kP)var}
+ compadd $addclose - ${(kP)var}
fi
else
compgen -v
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author