1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-11 08:00:06 +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 if [[ -z $field ]]; then
field=${s:-x} field=${s:-x}
elif [[ $field == (name|version) ]]; then elif [[ $field == (name|version) ]]; then
(( ! $+found[$field] )) || return (( ! $+found[$field] )) || return
[[ -n $s ]] || return [[ -n $s ]] || return
print -v 'found[$field]' -- $s # this isn't quite right but close enough [[ $s != *($'\n'|'\')* ]] || return
found[$field]=$s
(( $#found == 2 )) && break (( $#found == 2 )) && break
fi fi
;; ;;
@ -2102,8 +2103,7 @@ prompt_package() {
P9K_PACKAGE_NAME=$_p9k__cache_val[2] P9K_PACKAGE_NAME=$_p9k__cache_val[2]
P9K_PACKAGE_VERSION=$_p9k__cache_val[3] 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 '' ${P9K_PACKAGE_VERSION//\%/%%}
_p9k_prompt_segment "$0" "cyan" "$_p9k_color1" PACKAGE_ICON 0 '' $text
} }
################################################################ ################################################################
@ -7495,7 +7495,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=$'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+=$'${#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\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays\1'