Subject: [patch] Missing -- in _subscript
From: Matthew Martin <[email-masked]>
To: [email-masked]
Date: Wed, 18 May 2016 22:08:57 -0500
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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=--