From af983e9788b8977b71a841232296c93cd49fa1ef Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 7 May 2012 14:13:50 -0400 Subject: [PATCH] [Fix #167] Use an anononymous function for $fpath --- helper.zsh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/helper.zsh b/helper.zsh index b803b6cf..a13c083d 100644 --- a/helper.zsh +++ b/helper.zsh @@ -33,23 +33,23 @@ function autoloadable { # Loads Oh My Zsh modules. function omodload { local omodule - local ofunction - # Extended globbing is needed for autoloading of module functions. - setopt EXTENDED_GLOB + function { + local ofunction - # Add functions to fpath. - fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath) + # Extended globbing is needed for listing autoloadable function directories. + setopt LOCAL_OPTIONS EXTENDED_GLOB - # Load Oh My Zsh functions. - for ofunction in \ - $OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup|README*)(.N:t) - do - autoload -Uz "$ofunction" - done + # Add functions to fpath. + fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath) - # Extended globbing is no longer needed. - unsetopt EXTENDED_GLOB + # Load Oh My Zsh functions. + for ofunction in \ + $OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup|README*)(.N:t) + do + autoload -Uz "$ofunction" + done + } "$argv[@]" for omodule in "$argv[@]"; do if zstyle -t ":omz:module:$omodule" loaded; then