Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[patch] Missing -- in _subscript



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



Messages sorted by: Reverse Date, Date, Thread, Author