]> arthur.barton.de Git - ax-zsh.git/blobdiff - ax.zsh
Introduce new "ax-io" stage, which is run before all other stages
[ax-zsh.git] / ax.zsh
diff --git a/ax.zsh b/ax.zsh
index 197c5f0928a0da84d4aa8ded8a9028f5e78082a2..2d7bd66b6093f705d3cca365871fcb098612285e 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -7,7 +7,7 @@ script_type="$script_name[2,-1]"
 # Handle "initialization stage", load all plugins of that stage, either from an
 # existing cache file or individually, optionally creating the cache.
 # - $1: Script name
-# - $2: Stage name (zprofile, zshrc, zlogin, zlogout)
+# - $2: Stage name (ax-io, zprofile, zshrc, zlogin, zlogout)
 function axzsh_handle_stage {
        name="$1"
        type="$2"
@@ -101,7 +101,7 @@ function axzsh_load_plugin {
 
        if [[ ! -r "$fname" && "$type" == "zshrc" ]]; then
                zsh_themes=("$dname/"*.zsh-theme(NY1))
-               if [[ -r "$dname/$plugin.zprofile" || -r "$dname/$plugin.zlogout" ]]; then
+               if [[ -r "$dname/$plugin.ax-io" || -r "$dname/$plugin.zprofile" || -r "$dname/$plugin.zlogout" ]]; then
                        # Native AX-ZSH plugin, but for different stage. Skip it!
                        :
                elif [[ -r "$dname/${plugin_short}.plugin.zsh" ]]; then
@@ -201,6 +201,11 @@ if [[ -z "$AXZSH" ]]; then
        fi
 fi
 
+if [[ "$script_type" = "zprofile" ]]; then
+       # Load all "output" plugins first, that is, before the "zprofile stage":
+       axzsh_handle_stage "$script_name" "ax-io"
+fi
+
 axzsh_handle_stage "$script_name" "$script_type"
 
 # Clean up ...