1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-26 00:41:57 +00:00

add POWERLEVEL9K_RBENV_SOURCES; fixes #372

This commit is contained in:
romkatv 2019-12-12 15:38:56 +01:00
parent 82aba01ea8
commit 5591ad2290
4 changed files with 20 additions and 5 deletions

View file

@ -620,7 +620,10 @@
################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
# Pyenv color. # Pyenv color.
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
# Don't show the current Python version if it's the same as global. # Hide python version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
# If set to false, hide python version if it's the same as global:
# $(pyenv version-name) == $(pyenv global).
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -596,7 +596,10 @@
################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
# Pyenv color. # Pyenv color.
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
# Don't show the current Python version if it's the same as global. # Hide python version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
# If set to false, hide python version if it's the same as global:
# $(pyenv version-name) == $(pyenv global).
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -630,7 +630,10 @@
# Pyenv color. # Pyenv color.
# typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 # typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0
# typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 # typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4
# Don't show the current Python version if it's the same as global. # Hide python version if it doesn't come from one of these sources.
typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
# If set to false, hide python version if it's the same as global:
# $(pyenv version-name) == $(pyenv global).
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -3149,15 +3149,20 @@ function _p9k_pyenv_global_version() {
prompt_pyenv() { prompt_pyenv() {
(( $+commands[pyenv] || $+functions[pyenv] )) || return (( $+commands[pyenv] || $+functions[pyenv] )) || return
local v=${(j.:.)${(@)${(s.:.)PYENV_VERSION}#python-}} local v=${(j.:.)${(@)${(s.:.)PYENV_VERSION}#python-}}
if [[ -z $v ]]; then if [[ -n $v ]]; then
(( ${_POWERLEVEL9K_PYENV_SOURCES[(I)shell]} )) || return
else
(( ${_POWERLEVEL9K_PYENV_SOURCES[(I)local|global]} )) || return
[[ $PYENV_DIR == /* ]] && local dir=$PYENV_DIR || local dir="$_p9k_pwd_a/$PYENV_DIR" [[ $PYENV_DIR == /* ]] && local dir=$PYENV_DIR || local dir="$_p9k_pwd_a/$PYENV_DIR"
while true; do while true; do
if _p9k_read_pyenv_version_file $dir/.python-version; then if _p9k_read_pyenv_version_file $dir/.python-version; then
(( ${_POWERLEVEL9K_PYENV_SOURCES[(I)local]} )) || return
v=$_p9k_ret v=$_p9k_ret
break break
fi fi
if [[ $dir == / ]]; then if [[ $dir == / ]]; then
(( _POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW )) || return (( _POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW )) || return
(( ${_POWERLEVEL9K_PYENV_SOURCES[(I)global]} )) || return
_p9k_pyenv_global_version _p9k_pyenv_global_version
v=$_p9k_ret v=$_p9k_ret
break break
@ -4944,6 +4949,7 @@ _p9k_init_params() {
_p9k_declare -e POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")" _p9k_declare -e POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")"
_p9k_declare -a POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES -- virtualenv venv .venv _p9k_declare -a POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES -- virtualenv venv .venv
_p9k_declare -b POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -a POWERLEVEL9K_PYENV_SOURCES -- shell local global
_p9k_declare -b POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -b POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION 1 _p9k_declare -b POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION 1
_p9k_declare -e POWERLEVEL9K_NODEENV_LEFT_DELIMITER "[" _p9k_declare -e POWERLEVEL9K_NODEENV_LEFT_DELIMITER "["
@ -5430,7 +5436,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1 [[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit _p9k_deinit
fi fi
_p9k__param_pat=$'v14\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat=$'v15\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1'
_p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\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' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1'
_p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays'