From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20640 invoked from network); 10 Jun 1999 11:07:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Jun 1999 11:07:31 -0000 Received: (qmail 4792 invoked by alias); 10 Jun 1999 11:07:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6568 Received: (qmail 4785 invoked from network); 10 Jun 1999 11:07:07 -0000 Date: Thu, 10 Jun 1999 13:07:05 +0200 (MET DST) Message-Id: <199906101107.NAA23675@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Thu, 10 Jun 1999 12:22:54 +0200 Subject: Re: PATCH: pws-21: _vars 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[ 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['. 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@informatik.hu-berlin.de