Must use index 0 for funcstack

Normally zsh arrays start at index 1 but when emulating other shells
this may change.  During completion, we run the command
  emulate -L sh
which affects the indexing of zsh arrays to make it start at 0.

Consequently, when replacing FUNCNAME by funcstack, we should not
change the index.

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
pull/5425/head
Marc Khouzam 7 years ago
parent 4fec4b6766
commit 9cc6902875

@ -213,7 +213,7 @@ __helm_convert_bash_to_zsh() {
-e "s/${LWORD}declare${RWORD}/__helm_declare/g" \
-e "s/\\\$(type${RWORD}/\$(__helm_type/g" \
-e 's/aliashash\["\(.\{1,\}\)"\]/aliashash[\1]/g' \
-e 's/FUNCNAME\[0\]/funcstack[1]/g' \
-e 's/FUNCNAME/funcstack/g' \
<<'BASH_COMPLETION_EOF'
`
out.Write([]byte(zshInitialization))

Loading…
Cancel
Save