don't unsetopt aliases when the theme is sourced twice

This commit is contained in:
romkatv 2019-10-05 10:43:50 +02:00
parent 6d16760253
commit bacb43775d

View file

@ -11,12 +11,14 @@
################################################################
# Temporarily change options.
'builtin' 'local' '-a' '_p9k_src_opts'
[[ ! -o 'aliases' ]] || _p9k_src_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || _p9k_src_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || _p9k_src_opts+=('no_brace_expand')
'builtin' 'local' '-a' '__p9k_src_opts'
[[ ! -o 'aliases' ]] || __p9k_src_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || __p9k_src_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || __p9k_src_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
echo saved ${__p9k_src_opts[@]}
typeset -g __p9k_root_dir=${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}
typeset -g __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
@ -40,5 +42,6 @@ typeset -g __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
source $__p9k_root_dir/internal/p10k.zsh || true
}
(( ${#_p9k_src_opts} )) && setopt ${_p9k_src_opts[@]}
'builtin' 'unset' '_p9k_src_opts'
echo setopt ${__p9k_src_opts[@]}
(( ${#__p9k_src_opts} )) && setopt ${__p9k_src_opts[@]}
'builtin' 'unset' '__p9k_src_opts'