Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no
	version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:subject:message-id:mail-followup-to:mime-version
         :content-disposition:user-agent;
        bh=/CY1be0Ax56Aw+e4ithDTQDDdxqARvaTsnSf04YL2iA=;
        b=H69yNSwLZh/19M5E/cpPyn08Lccgnaw1HfaLgDq7sxXWqtIZin298tBFDXX79bGvgc
         rdPqzaAGZyeh6+JVCRgKf49ZQMxyoOvUo3mh6ozA+QfHCceVuqmn1ZzWmjbqEUYPKK1r
         1fvnEiB36hfZcsmw13Hci8WkMvgVnIyznZXLeR8XJPOmAKA9KCNpSYY3odkmJ0LI91aG
         HB6fLt7YpbGKkNCikgpKrpYXj4quhxRiC2qUIvIyJ27cURE1/ZXAj1DDpow8YMkuUMh+
         VQzMy64wccGKqTV0AXrc03P2El5mnw8Cn3Fx2i6ve3xJn2WYp3ypt+ex2fi6P1xJgRPV
         SNag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to
         :mime-version:content-disposition:user-agent;
        bh=/CY1be0Ax56Aw+e4ithDTQDDdxqARvaTsnSf04YL2iA=;
        b=kLIJifV3/2y69HUX2kO6aPx6W2g5liCuUyosN5wRuKM75RYgm6EeCC9wIedcPi0g9q
         LJqPc2Y+Qf3oWsalJHlEcV+CuJppoXqod8m+8+hacWUgdodnig+Lgxxyewrkw3KTOU+Y
         HnSFKSSEtw0mW8/NcSF5Djzn4QCNK5J/y5BfoO8IN7xYfQSN7ZKHzHs9etdKmxAN3McA
         Ga+a78y/Z0Y/Gxna5Me9ikCDbsUwDn3guGnA4r4o+jP8kMVzKDwlFU3JcVnj+MDyWe2S
         dpAdUTQlYtit23x/NtXxTo2UTlKZ8KIeI9NcCwnPCGqtmkRmhvDvotBrtrbNFx4pyRl1
         IK3g==
X-Gm-Message-State: AOPr4FVrt99rwrKtx0kFjGdb3brAKqtfqEUaQpQ0jESziVcGrMrgcdGjOFHKxX4Zs82ZvQ==
X-Received: by 10.202.107.4 with SMTP id g4mr6408246oic.184.1463627340773;
        Wed, 18 May 2016 20:09:00 -0700 (PDT)
Date: Wed, 18 May 2016 22:08:57 -0500
From: Matthew Martin <phy1729@gmail.com>
To: zsh-workers@zsh.org
Subject: [patch] Missing -- in _subscript
Message-ID: <20160519030857.GC94229@CptOrmolo.darkstar>
Mail-Followup-To: zsh-workers@zsh.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.6.1 (2016-04-27)
X-Seq: zsh-workers 38515

The print is missing a -- before variable input. Ran into this when
doing print $historywords[<tab>.

Also change some arr=( "$arr[@]" foo ) to arr+=( foo ) while here.


diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 80642d8..88813b5 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -99,10 +99,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
         list=()
         for i in "$ind[@]"; do
           if [[ "$i" = ${PREFIX}*${SUFFIX} ]]; then
-              list=( "$list[@]" 
-	             "${i}:$(print -D ${(P)${compstate[parameter]}[$i]})" )
+              list+=( "${i}:$(print -D -- ${(P)${compstate[parameter]}[$i]})" )
 	  else
-	      list=( "$list[@]" '' )
+	      list+=( '' )
 	  fi
         done
         zstyle -s ":completion:${curcontext}:indexes" list-separator sep || sep=--

