From 2e5a085dbef51418a22bb326c5a246e4ccb79d11 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 30 Jul 2019 15:11:58 +0200 Subject: [PATCH] run configuration wizard automatically if no POWERLEVEL9K options are defined --- internal/p10k.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index ce6cfa14..87aaa184 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3277,7 +3277,18 @@ _p9k_precmd() { unset _p9k_real_zle_rprompt_indent fi - _p9k_must_init && _p9k_init + if _p9k_must_init; then + if (( !__p9k_configured )); then + __p9k_configured=1 + if [[ -z ${parameters[(i)POWERLEVEL9K_*]} ]] && _p9k_can_configure -q; then + if $__p9k_root_dir/internal/wizard.zsh -d $__p9k_root_dir; then + source $__p9k_cfg_path + _p9k_must_init + fi + fi + fi + _p9k_init + fi unsetopt localoptions prompt_opts=(cr percent sp subst) @@ -4294,6 +4305,7 @@ _p9k_deinit() { } typeset -gi __p9k_enabled=0 +typeset -gi __p9k_configured=0 prompt_powerlevel9k_setup() { emulate -L zsh && setopt no_hist_expand extended_glob