1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

display only the version (without name) in package by default

This commit is contained in:
romkatv 2020-03-10 09:29:29 +01:00
parent 3308f18863
commit ca8ec45f7a

View file

@ -2085,9 +2085,10 @@ prompt_package() {
if [[ -z $field ]]; then
field=${s:-x}
elif [[ $field == (name|version) ]]; then
(( ! $+found[$field] )) || return
[[ -n $s ]] || return
print -v 'found[$field]' -- $s # this isn't quite right but close enough
(( ! $+found[$field] )) || return
[[ -n $s ]] || return
[[ $s != *($'\n'|'\')* ]] || return
found[$field]=$s
(( $#found == 2 )) && break
fi
;;
@ -2102,8 +2103,7 @@ prompt_package() {
P9K_PACKAGE_NAME=$_p9k__cache_val[2]
P9K_PACKAGE_VERSION=$_p9k__cache_val[3]
local text="${${P9K_PACKAGE_NAME##*/}//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}"
_p9k_prompt_segment "$0" "cyan" "$_p9k_color1" PACKAGE_ICON 0 '' $text
_p9k_prompt_segment "$0" "cyan" "$_p9k_color1" PACKAGE_ICON 0 '' ${P9K_PACKAGE_VERSION//\%/%%}
}
################################################################
@ -7495,7 +7495,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit
fi
_p9k__param_pat=$'v71\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1'
_p9k__param_pat=$'v72\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\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+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays\1'