mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 21:41:57 +00:00
add POWERLEVEL9K_VCS_COMMITS_{AHEAD,BEHIND}_MAX_NUM
This commit is contained in:
parent
80a8662e5a
commit
4b4c8af9c6
1 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue