]> arthur.barton.de Git - ax-zsh.git/commitdiff
Include the theme into the global context
authorAlexander Barton <alex@barton.de>
Sun, 3 Feb 2019 21:51:49 +0000 (22:51 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 3 Feb 2019 21:51:49 +0000 (22:51 +0100)
This is required by some (OhMyZsh) themes ...

ax.zsh
core/90_theme/90_theme.zshrc

diff --git a/ax.zsh b/ax.zsh
index fbacf6cb2ad1a5e1c1910bc31e9c3974165a2b63..4387f8d532416d623c154fcc53dcfe9fdeba8181 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -177,6 +177,19 @@ else
        for plugin ($plugin_list); do
                axzsh_load_plugin "$plugin" "$script_type" "$cache_file"
        done
+
+       # Read the "theme file", if any and in "zshrc" stage:
+       if [[ "$script_type" = "zshrc" ]]; then
+               if [[ -r "$AXZSH_THEME" ]]; then
+                       source "$AXZSH_THEME"
+                       if [[ -n "$cache_file" ]]; then
+                               # Include the theme into the new cache file:
+                               echo "# BEGIN Theme" >>"$cache_file"
+                               "$cat_cmd" "$AXZSH_THEME" >>"$cache_file"
+                               echo "# END Theme" >>"$cache_file"
+                       fi
+               fi
+       fi
 fi
 
 # Clean up ...
index 4c508fba672401bb7f914049f1ad99664ab5f356..140c73aa968d7fbd398897c6e9cbdb0c97713dbf 100644 (file)
@@ -5,14 +5,15 @@
 # simple and sane built-in prompt that should work "everywhere". And try to
 # make sure that nothing else "disturbs" such terminals ...
 if axzsh_is_dumb_terminal; then
+       unset AXZSH_THEME
+
+       # Set simple prompt:
        PS1="%n@%m:%3~ %# "
        unset RPS1
 
        # See <https://github.com/syl20bnr/spacemacs/issues/3035>
        unset zle_bracketed_paste
-
-       return
 fi
 
-# Read in the theme configuration.
-[[ -n "$AXZSH_THEME" ]] && source "$AXZSH_THEME"
+# NOTE: The theme itself is read in by the ax.zsh script itself: last and into
+# the global context (code for the cache file is generated as required).