diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-10-03 15:50:08 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-10-03 15:50:08 +0300 |
commit | aa606e6cb0cb6ae852cca343fbffe72ed8015a1c (patch) | |
tree | 6e4dc6e70300396028ca242cdc29f429b008cfad /powerlevel9k.zsh-theme | |
parent | 0cb680edd1989e6a643b320ab28e2618bd8d068d (diff) |
don't print options when no_aliases, no_sh_glob and brace_expand are all set
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 8a0dc15b..9d2847ce 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -10,12 +10,12 @@ # https://github.com/robbyrussell/oh-my-zsh/blob/74177c5320b2a1b2f8c4c695c05984b57fd7c6ea/themes/agnoster.zsh-theme ################################################################ -if [[ -o 'aliases' ]]; then - 'builtin' 'unsetopt' 'aliases' - local __p9k_restore_aliases=1 -else - local __p9k_restore_aliases=0 -fi +# 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' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' typeset -g __p9k_root_dir="${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}" @@ -34,5 +34,5 @@ typeset -g __p9k_root_dir="${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}" source $__p9k_root_dir/internal/p10k.zsh || true } -(( ! __p9k_restore_aliases )) || setopt aliases -'builtin' 'unset' '__p9k_restore_aliases' +(( ${#_p9k_src_opts} )) && setopt ${_p9k_src_opts[@]} +'builtin' 'unset' '_p9k_src_opts' |