summaryrefslogtreecommitdiff
path: root/powerlevel10k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-04-05 07:54:20 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-04-05 07:54:20 +0300
commitb2667b8270fa103eb6558ef719fb872fec0fc51b (patch)
treeebab94b9c6d2a50586e48f1a4c9f1693bc6436d3 /powerlevel10k.zsh-theme
parentc71606cd833f60a9b74573b50000fb6a6a9eab17 (diff)
don't compile sources if zsh is < 5.1
Diffstat (limited to 'powerlevel10k.zsh-theme')
-rw-r--r--powerlevel10k.zsh-theme28
1 files changed, 15 insertions, 13 deletions
diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme
index 0e4cc5cd..90b19657 100644
--- a/powerlevel10k.zsh-theme
+++ b/powerlevel10k.zsh-theme
@@ -54,19 +54,21 @@ function _p9k_init_locale() {
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit
fi
- typeset -gr __p9k_sourced=7
- if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
- local f
- for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do
- [[ $f.zwc -nt $f ]] && continue
- zmodload -F zsh/files b:zf_mv b:zf_rm
- local tmp=$f.tmp.$$.zwc
- {
- zcompile -R -- $tmp $f && zf_mv -f -- $tmp $f.zwc
- } always {
- (( $? )) && zf_rm -f -- $tmp
- }
- done
+ typeset -gr __p9k_sourced=8
+ if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then
+ if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then
+ local f
+ for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do
+ [[ $f.zwc -nt $f ]] && continue
+ zmodload -F zsh/files b:zf_mv b:zf_rm
+ local tmp=$f.tmp.$$.zwc
+ {
+ zcompile -R -- $tmp $f && zf_mv -f -- $tmp $f.zwc
+ } always {
+ (( $? )) && zf_rm -f -- $tmp
+ }
+ done
+ fi
fi
source $__p9k_root_dir/internal/p10k.zsh || true
}