aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-11 20:20:39 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-11 20:20:39 +0300
commit14366ed0ce96d1360dae2f0cc42ad0a1a4a576b8 (patch)
tree2497bafee750e37937d25480296eaf786176d7f8 /powerlevel9k.zsh-theme
parent7d7a3404dc4d9927d03b82eb870006b96d0d4525 (diff)
make git-is-slow stickier
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme8
1 files changed, 6 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 38af2fcd..1bdb6f8a 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1749,8 +1749,12 @@ typeset -fH _p9k_vcs_render() {
typeset -fH _p9k_vcs_resume() {
if [[ $VCS_STATUS_RESULT == ok-async ]]; then
- local slow=$((EPOCHREALTIME - _P9K_GITSTATUS_START_TIME > POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS))
- _P9K_GIT_SLOW[$VCS_STATUS_WORKDIR]=$slow
+ local latency=$((EPOCHREALTIME - _P9K_GITSTATUS_START_TIME))
+ if (( latency > POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS )); then
+ _P9K_GIT_SLOW[$VCS_STATUS_WORKDIR]=1
+ elif (( latency < 0.8 * POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS )); then # 0.8 to avoid flip-flopping
+ _P9K_GIT_SLOW[$VCS_STATUS_WORKDIR]=0
+ fi
fi
if [[ -z $_P9K_NEXT_VCS_DIR ]]; then