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

This commit is contained in:
Sorin Ionescu 2012-05-07 14:13:50 -04:00
parent e79fc7a1aa
commit af983e9788

View file

@ -33,10 +33,12 @@ function autoloadable {
# Loads Oh My Zsh modules. # Loads Oh My Zsh modules.
function omodload { function omodload {
local omodule local omodule
function {
local ofunction local ofunction
# Extended globbing is needed for autoloading of module functions. # Extended globbing is needed for listing autoloadable function directories.
setopt EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
# Add functions to fpath. # Add functions to fpath.
fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath) fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath)
@ -47,9 +49,7 @@ function omodload {
do do
autoload -Uz "$ofunction" autoload -Uz "$ofunction"
done done
} "$argv[@]"
# Extended globbing is no longer needed.
unsetopt EXTENDED_GLOB
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