47d30784c53ed3159fb317d4a1a1cedb105aa278

Author
spreiter <36988897+spreiter@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

colorize: add compatibility for zsh < 5.1 (#9400)

The direct assignment of a local array is not possible in older ZSH version, as used by RHEL/CentOS 7.

Diff

 1diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
 2index 80b69190f0d0022ffe321939473778ba2bd752b0..cb5ac36f5ad0e75004b3c3a4a2a4309de07c251b 100644
 3--- a/plugins/colorize/colorize.plugin.zsh
 4+++ b/plugins/colorize/colorize.plugin.zsh
 5@@ -6,7 +6,8 @@ alias cless="colorize_less"
 6 ZSH_COLORIZE_PLUGIN_PATH=$0:A
 7 
 8 colorize_check_requirements() {
 9-    local available_tools=("chroma" "pygmentize")
10+    local -a available_tools
11+    available_tools=("chroma" "pygmentize")
12 
13     if [ -z "$ZSH_COLORIZE_TOOL" ]; then
14         if (( $+commands[pygmentize] )); then