nvm: implement POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW and default to false

pull/2296/head
Zaidhaan Hussain 2 years ago
parent 5d16c106ed
commit 4ed8aae324

@ -1007,6 +1007,9 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
# If set to false, hide node version if it's the same as default:
# $(nvm version current) == $(nvm version default).
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
# If set to false, hide node version if it's equal to "system". # If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.

@ -988,6 +988,9 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 typeset -g POWERLEVEL9K_NVM_FOREGROUND=2
# If set to false, hide node version if it's the same as default:
# $(nvm version current) == $(nvm version default).
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
# If set to false, hide node version if it's equal to "system". # If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.

@ -984,6 +984,9 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
# If set to false, hide node version if it's the same as default:
# $(nvm version current) == $(nvm version default).
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
# If set to false, hide node version if it's equal to "system". # If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.

@ -1053,6 +1053,9 @@
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 typeset -g POWERLEVEL9K_NVM_FOREGROUND=0
typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 typeset -g POWERLEVEL9K_NVM_BACKGROUND=5
# If set to false, hide node version if it's the same as default:
# $(nvm version current) == $(nvm version default).
typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
# If set to false, hide node version if it's equal to "system". # If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.

@ -2567,7 +2567,10 @@ _p9k_nvm_ls_current() {
prompt_nvm() { prompt_nvm() {
[[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return [[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return
local current=$_p9k__ret local current=$_p9k__ret
! _p9k_nvm_ls_default || [[ $_p9k__ret != $current ]] || return _p9k_nvm_ls_default
if (( !_POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW )); then
[[ $current == $_p9k__ret ]] && return
fi
if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then
[[ $current == system ]] && return [[ $current == system ]] && return
fi fi
@ -7533,6 +7536,7 @@ _p9k_init_params() {
_p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global
_p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1
_p9k_declare -b POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW 0
_p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1
_p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global

Loading…
Cancel
Save