[Fix #167] Use an anononymous function for $fpath
This commit is contained in:
parent
e79fc7a1aa
commit
af983e9788
1 changed files with 13 additions and 13 deletions
10
helper.zsh
10
helper.zsh
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue