From 146852ac4d5c15bd823f28d1c93b427e0896127f Mon Sep 17 00:00:00 2001 From: Ben O'Hara Date: Sun, 17 Jun 2012 14:58:48 +1000 Subject: [PATCH] Fixes loading the functions under older zsh versions omodule not omodules omodules --- helper.zsh | 27 +++++++++++---------------- modules/completion/functions | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/helper.zsh b/helper.zsh index 7c960b20..e6515abc 100644 --- a/helper.zsh +++ b/helper.zsh @@ -38,22 +38,8 @@ function omodload { # $argv is overridden in the anonymous function. omodules=("$argv[@]") - function { - local ofunction - - # 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 - } + # Extended globbing is needed for listing autoloadable function directories. + setopt LOCAL_OPTIONS EXTENDED_GLOB for omodule in "$omodules[@]"; do if zstyle -t ":omz:module:$omodule" loaded; then @@ -68,6 +54,15 @@ function omodload { if (( $? == 0 )); then 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 zstyle ":omz:module:$omodule" loaded 'no' fi diff --git a/modules/completion/functions b/modules/completion/functions index 8b89dd9d..39e26ca0 160000 --- a/modules/completion/functions +++ b/modules/completion/functions @@ -1 +1 @@ -Subproject commit 8b89dd9d10e86313f49fafdf88e8540f97346f33 +Subproject commit 39e26ca01fabcaa6f20d4638f56f9866a82f2b1f