diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2022-11-02 17:55:35 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2022-11-02 17:55:35 +0300 |
commit | 5a3109e40d2843d5e93d238568abaf5d5bc5d85a (patch) | |
tree | 93b1862b285d8e370a80de256489c5a5cfcb683e /internal | |
parent | f68197a3aaee4a04f203f067090c148236958ef1 (diff) |
replace POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY with POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN (#2072)
POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN defines a pattern that
RUBY_ENGINE should match for it to be shown. Matching is done
with extended_glob.
For example, to show all values of RUBY_ENGINE except "ruby":
POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN='^ruby'
If POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN is unset and
POWERLEVEL9K_CHRUBY_SHOW_ENGINE is set to true,
the behavior is the same as if POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN
was set to *.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/p10k.zsh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6cf6e6b5..70c83c7b 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3138,11 +3138,8 @@ _p9k_prompt_perlbrew_init() { # Segment to display chruby information # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH prompt_chruby() { - local v - if (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && [[ "$RUBY_ENGINE" != "ruby" || $_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY == 1 ]]; then - v=$RUBY_ENGINE - fi - if [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION + local v=${(M)RUBY_ENGINE:#$~_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN} + [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION _p9k_prompt_segment "$0" "red" "$_p9k_color1" 'RUBY_ICON' 0 '' "${v//\%/%%}" } @@ -7536,7 +7533,10 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_RVM_SHOW_PREFIX 0 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_VERSION 1 _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE 1 - _p9k_declare -b POWERLEVEL9K_CHRUBY_SHOW_ENGINE_IF_RUBY 1 + _p9k_declare -s POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN + if (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )); then + : ${_POWERLEVEL9K_CHRUBY_SHOW_ENGINE_PATTERN=*} + fi _p9k_declare -b POWERLEVEL9K_STATUS_CROSS 0 _p9k_declare -b POWERLEVEL9K_STATUS_OK 1 _p9k_declare -b POWERLEVEL9K_STATUS_OK_PIPE 1 @@ -8334,7 +8334,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v136\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v137\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$__p9k_force_term_shell_integration$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' |