From 13eb86d4c82ed804e680f74e0ebfb3562d10e9c0 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 9 Apr 2018 18:20:54 -0500 Subject: [PATCH] And also simplify functions glob in init.zsh to match the change done in `login_init.zsh`. Also call autoloaded function only when autoload succeeded. --- init.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.zsh b/init.zsh index 7f5c6b6..73afd2c 100755 --- a/init.zsh +++ b/init.zsh @@ -2,8 +2,7 @@ # Zim initializition # -autoload -Uz is-at-least -if ! is-at-least 5.2; then +autoload -Uz is-at-least && if ! is-at-least 5.2; then print "ERROR: Zim didn't start. You're using zsh version ${ZSH_VERSION}, and versions < 5.2 are not supported. Update your zsh." >&2 return 1 fi @@ -22,7 +21,7 @@ fi # autoload searches fpath for function locations; add enabled module function paths fpath=(${ZIM_HOME}/modules/${^zmodules}/functions(/FN) ${fpath}) - for mod_function in ${ZIM_HOME}/modules/${^zmodules}/functions/^([_.]*|prompt_*_setup|README*|*.zwc|*.zwc.old)(-.N:t); do + for mod_function in ${ZIM_HOME}/modules/${^zmodules}/functions/^(_*|prompt_*_setup|*.*)(-.N:t); do autoload -Uz ${mod_function} done }