1
0
Fork 0

Fixes loading the functions under older zsh versions

pull/199/head^2
Ben O'Hara 13 years ago
parent 2a0a7b3061
commit c6bc0845e9

@ -38,22 +38,8 @@ function omodload {
# $argv is overridden in the anonymous function. # $argv is overridden in the anonymous function.
omodules=("$argv[@]") omodules=("$argv[@]")
function { # Extended globbing is needed for listing autoloadable function directories.
local ofunction setopt LOCAL_OPTIONS EXTENDED_GLOB
# Extended globbing is needed for listing autoloadable function directories.
setopt LOCAL_OPTIONS EXTENDED_GLOB
# Add functions to fpath.
fpath=(${omodules:+${OMZ}/modules/${^omodules}/functions(/FN)} $fpath)
# Load Oh My Zsh functions.
for ofunction in \
$OMZ/modules/${^omodules}/functions/^([_.]*|prompt_*_setup|README*)(.N:t)
do
autoload -Uz "$ofunction"
done
}
for omodule in "$omodules[@]"; do for omodule in "$omodules[@]"; do
if zstyle -t ":omz:module:$omodule" loaded; then if zstyle -t ":omz:module:$omodule" loaded; then
@ -68,6 +54,15 @@ function omodload {
if (( $? == 0 )); then if (( $? == 0 )); then
zstyle ":omz:module:$omodule" loaded 'yes' zstyle ":omz:module:$omodule" loaded 'yes'
# Add functions to fpath.
fpath=(${omodules:+${OMZ}/modules/${^omodules}/functions(/FN)} $fpath)
# Load Oh My Zsh functions.
for ofunction in \
$OMZ/modules/${^omodules}/functions/^([_.]*|prompt_*_setup|README*)(.N:t)
do
autoload -Uz "$ofunction"
done
else else
zstyle ":omz:module:$omodule" loaded 'no' zstyle ":omz:module:$omodule" loaded 'no'
fi fi

@ -8,13 +8,6 @@
# Load and execute the prompt theming system. # Load and execute the prompt theming system.
autoload -Uz promptinit && promptinit autoload -Uz promptinit && promptinit
# Check for the minimum supported version.
min_zsh_version='4.3.10'
if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then
return 1
fi
unset min_zsh_version
# Load the prompt theme. # Load the prompt theme.
zstyle -a ':omz:module:prompt' theme 'prompt_argv' zstyle -a ':omz:module:prompt' theme 'prompt_argv'
if (( $#prompt_argv > 0 )); then if (( $#prompt_argv > 0 )); then

Loading…
Cancel
Save