bug fix: show previous repo state instead of loading when in a subdir of a slow repo

pull/70/head
romkatv 6 years ago
parent 1f8cd36f73
commit 902e8eb24d

@ -1685,16 +1685,17 @@ function _p9k_vcs_render() {
local dir=${${GIT_DIR:a}:-$PWD} local dir=${${GIT_DIR:a}:-$PWD}
while true; do while true; do
msg=("${(@0)${_P9K_LAST_GIT_PROMPT[$dir]}}") msg=("${(@0)${_P9K_LAST_GIT_PROMPT[$dir]}}")
[[ $#msg != 0 || $dir == / ]] && break [[ $#msg -gt 1 || -n ${msg[1]} ]] && break
[[ $dir == / ]] && msg=() && break
dir=${dir:h} dir=${dir:h}
done done
if [[ $#msg -lt 2 && -z ${msg[1]} ]]; then if (( $#msg )); then
$2_prompt_segment $1_LOADING $3 "${vcs_states[loading]}" "$DEFAULT_COLOR" '' 0 '' "${msg[@]}"
else
_p9k_get_icon VCS_LOADING_ICON _p9k_get_icon VCS_LOADING_ICON
if [[ -n $_P9K_RETVAL || -n $POWERLEVEL9K_VCS_LOADING_TEXT ]]; then if [[ -n $_P9K_RETVAL || -n $POWERLEVEL9K_VCS_LOADING_TEXT ]]; then
$2_prompt_segment $1_LOADING $3 "${vcs_states[loading]}" "$DEFAULT_COLOR" VCS_LOADING_ICON 0 '' "$POWERLEVEL9K_VCS_LOADING_TEXT" $2_prompt_segment $1_LOADING $3 "${vcs_states[loading]}" "$DEFAULT_COLOR" VCS_LOADING_ICON 0 '' "$POWERLEVEL9K_VCS_LOADING_TEXT"
fi fi
else
$2_prompt_segment $1_LOADING $3 "${vcs_states[loading]}" "$DEFAULT_COLOR" '' 0 '' "${msg[@]}"
fi fi
return 0 return 0
fi fi

Loading…
Cancel
Save