diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-06-04 11:39:21 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-06-04 11:39:21 +0300 |
commit | 4b4c8af9c64790ff8425a903869e8a9c808e1fc8 (patch) | |
tree | d955eb5aa479a6490af5296918984cb45c7baa45 /internal/p10k.zsh | |
parent | 80a8662e5a14929521bdb507b91d45b1162ec094 (diff) |
add POWERLEVEL9K_VCS_COMMITS_{AHEAD,BEHIND}_MAX_NUM
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-x | internal/p10k.zsh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 89a93514..eb02e49d 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1694,6 +1694,12 @@ function _p9k_vcs_render() { (( ${POWERLEVEL9K_VCS_GIT_HOOKS[(I)git-remotebranch]} )) || VCS_STATUS_REMOTE_BRANCH="" (( ${POWERLEVEL9K_VCS_GIT_HOOKS[(I)git-tagname]} )) || VCS_STATUS_TAG="" + (( POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM >= 0 && VCS_STATUS_COMMITS_AHEAD > POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM )) && + VCS_STATUS_COMMITS_AHEAD=$POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM + + (( POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM >= 0 && VCS_STATUS_COMMITS_BEHIND > POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM )) && + VCS_STATUS_COMMITS_BEHIND=$POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM + local -a cache_key=( "$VCS_STATUS_LOCAL_BRANCH" "$VCS_STATUS_REMOTE_BRANCH" @@ -1797,11 +1803,13 @@ function _p9k_vcs_render() { fi if [[ $VCS_STATUS_COMMITS_AHEAD -gt 0 ]]; then _p9k_get_icon VCS_OUTGOING_CHANGES_ICON - _$0_fmt OUTGOING_CHANGES " $_P9K_RETVAL$VCS_STATUS_COMMITS_AHEAD" + (( POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM != 1 )) && _P9K_RETVAL+=$VCS_STATUS_COMMITS_AHEAD + _$0_fmt OUTGOING_CHANGES " $_P9K_RETVAL" fi if [[ $VCS_STATUS_COMMITS_BEHIND -gt 0 ]]; then _p9k_get_icon VCS_INCOMING_CHANGES_ICON - _$0_fmt INCOMING_CHANGES " $_P9K_RETVAL$VCS_STATUS_COMMITS_BEHIND" + (( POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM != 1 )) && _P9K_RETVAL+=$VCS_STATUS_COMMITS_BEHIND + _$0_fmt INCOMING_CHANGES " $_P9K_RETVAL" fi if [[ $VCS_STATUS_STASHES -gt 0 ]]; then _p9k_get_icon VCS_STASH_ICON @@ -2252,6 +2260,8 @@ set_default -i POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY -1 set_default -i POWERLEVEL9K_VCS_STAGED_MAX_NUM 1 set_default -i POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM 1 set_default -i POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM 1 +set_default -i POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM -1 +set_default -i POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM -1 typeset -g DEFAULT_COLOR typeset -g DEFAULT_COLOR_INVERTED |