From: Simon Ruderich Date: Thu, 12 Mar 2009 21:34:56 +0000 (+0100) Subject: zsh: Fix for 4.3.4 so add-zsh-hook works. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=c94d8d1c45563ec9a7170e4ed491f52f4ab1904e;p=config%2Fdotfiles.git zsh: Fix for 4.3.4 so add-zsh-hook works. It seems it's broken on at least this version. So the compatibility function in ~/.zsh/function/compatibility is used on this version too. As the function add-zsh-hook already exists, fpath was updated to load the compatibility functions first. --- diff --git a/zsh/rc b/zsh/rc index c9f516a..7c59aec 100644 --- a/zsh/rc +++ b/zsh/rc @@ -41,9 +41,12 @@ autoload ${fpath[1]}/^_*(^/:t) # Simulate hooks using _functions arrays for Zsh versions older then 4.3.4. At # the moment only precmd() and preexec() are simulated. -if [[ $ZSH_VERSION != (4.3.<4->|4.<4->*|<5->*) ]]; then +# +# At least 4.3.4 (not sure about later versions) has an error in add-zsh-hook +# so the compatibility version is used there too. +if [[ $ZSH_VERSION != (4.3.<5->|4.<4->*|<5->*) ]]; then # Provide add-zsh-hook which was added in 4.3.4. - fpath=($fpath ~/.zsh/functions/compatibility) + fpath=(~/.zsh/functions/compatibility $fpath) # Run all functions defined in the ${precmd,preexec}_functions arrays. function precmd() {