[Fix #167] Use an anononymous function for $fpath

main
Sorin Ionescu 13 years ago
parent e79fc7a1aa
commit af983e9788

@ -33,23 +33,23 @@ function autoloadable {
# Loads Oh My Zsh modules. # Loads Oh My Zsh modules.
function omodload { function omodload {
local omodule local omodule
local ofunction
# Extended globbing is needed for autoloading of module functions. function {
setopt EXTENDED_GLOB local ofunction
# Add functions to fpath. # Extended globbing is needed for listing autoloadable function directories.
fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath) setopt LOCAL_OPTIONS EXTENDED_GLOB
# Load Oh My Zsh functions. # Add functions to fpath.
for ofunction in \ fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath)
$OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup|README*)(.N:t)
do
autoload -Uz "$ofunction"
done
# Extended globbing is no longer needed. # Load Oh My Zsh functions.
unsetopt EXTENDED_GLOB for ofunction in \
$OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup|README*)(.N:t)
do
autoload -Uz "$ofunction"
done
} "$argv[@]"
for omodule in "$argv[@]"; do for omodule in "$argv[@]"; do
if zstyle -t ":omz:module:$omodule" loaded; then if zstyle -t ":omz:module:$omodule" loaded; then

Loading…
Cancel
Save