mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 12:20:07 +00:00
bug fix: show previous repo state instead of loading when in a subdir of a slow repo
This commit is contained in:
parent
1f8cd36f73
commit
902e8eb24d
1 changed files with 5 additions and 4 deletions
|
@ -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…
Reference in a new issue