minor fixes

pull/450/head
romkatv 5 years ago
parent 674e5fd029
commit 0a7f7c85c4

@ -223,6 +223,9 @@ function _p9k_fetch_cwd() {
~|/) ~|/)
_p9k__parent_dirs=() _p9k__parent_dirs=()
_p9k__parent_mtimes=() _p9k__parent_mtimes=()
_p9k__parent_mtimes_i=()
_p9k__parent_mtimes_s=
return
;; ;;
~/*) ~/*)
local parent=~/ local parent=~/
@ -1231,7 +1234,6 @@ prompt_fvm() {
if [[ ${link:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then if [[ ${link:A} == (#b)*/versions/([^/]##)/bin/flutter ]]; then
_p9k_prompt_segment $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%} _p9k_prompt_segment $0 blue $_p9k_color1 FLUTTER_ICON 0 '' ${match[1]//\%/%%}
fi fi
return
fi fi
} }
@ -1765,13 +1767,14 @@ prompt_dir() {
(( ++i )) (( ++i ))
fi fi
if (( i <= e )); then if (( i <= e )); then
local parent="${_p9k__cwd%/${(pj./.)parts[i,-1]}}"
local mtimes=(${(Oa)_p9k__parent_mtimes:$(($#parts-e)):$((e-i+1))}) local mtimes=(${(Oa)_p9k__parent_mtimes:$(($#parts-e)):$((e-i+1))})
local key="${(pj.:.)mtimes}" local key="${(pj.:.)mtimes}"
else else
local key= local key=
fi fi
if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd || [[ $key != $_p9k_cache_val[1] ]] ; then if ! _p9k_cache_ephemeral_get $0 $e $i $_p9k__cwd || [[ $key != $_p9k_cache_val[1] ]] ; then
local tail=${(j./.)parts[i,-1]}
local parent=$_p9k__cwd[1,-2-$#tail]
_p9k_prompt_length $delim _p9k_prompt_length $delim
local -i real_delim_len=_p9k_ret local -i real_delim_len=_p9k_ret
[[ -n $parts[i-1] ]] && parts[i-1]="\${(Q)\${:-${(qqq)${(q)parts[i-1]}}}}"$'\2' [[ -n $parts[i-1] ]] && parts[i-1]="\${(Q)\${:-${(qqq)${(q)parts[i-1]}}}}"$'\2'
@ -2684,7 +2687,7 @@ _p9k_prompt_plenv_init() {
# Segment to display chruby information # Segment to display chruby information
# see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH
prompt_chruby() { prompt_chruby() {
local v='' local v
(( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && v=$RUBY_ENGINE (( _POWERLEVEL9K_CHRUBY_SHOW_ENGINE )) && v=$RUBY_ENGINE
if [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION if [[ $_POWERLEVEL9K_CHRUBY_SHOW_VERSION == 1 && -n $RUBY_VERSION ]] && v+=${v:+ }$RUBY_VERSION
_p9k_prompt_segment "$0" "red" "$_p9k_color1" 'RUBY_ICON' 0 '' "${v//\%/%%}" _p9k_prompt_segment "$0" "red" "$_p9k_color1" 'RUBY_ICON' 0 '' "${v//\%/%%}"

Loading…
Cancel
Save