From c94d8d1c45563ec9a7170e4ed491f52f4ab1904e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 12 Mar 2009 22:34:56 +0100 Subject: [PATCH] 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. --- zsh/rc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() { -- 2.45.2