aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-06-07 00:52:15 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-06-07 00:52:15 +0300
commit154e9230339e85009407b01e4aff076a3d76efa9 (patch)
treea2d210af3347fadaec3c7eb47ac700821bc83096 /functions
parent45ae15370063568fe326ab9eadc4bac6d974179a (diff)
parent111d152d48cc92229cb523a992a0ecee740381e7 (diff)
Merge remote-tracking branch 'floor114/next' into staging_065
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/vcs.zsh15
1 files changed, 15 insertions, 0 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index f4729213..b99e7c86 100755
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh
@@ -51,6 +51,21 @@ function +vi-git-remotebranch() {
remote=${$(command git rev-parse --verify HEAD@{upstream} --symbolic-full-name 2>/dev/null)/refs\/(remotes|heads)\/}
branch_name=$(command git symbolic-ref --short HEAD 2>/dev/null)
+ if [[ -n "$POWERLEVEL9K_VCS_SHORTEN_LENGTH" ]] && [[ -n "$POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH" ]]; then
+ set_default POWERLEVEL9K_VCS_SHORTEN_DELIMITER $'\U2026'
+
+ if [ ${#hook_com[branch]} -gt $POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH ] && [ ${#hook_com[branch]} -gt $POWERLEVEL9K_VCS_SHORTEN_LENGTH ]; then
+ case "$POWERLEVEL9K_VCS_SHORTEN_STRATEGY" in
+ truncate_middle)
+ hook_com[branch]="$(echo "${branch_name:0:$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")$POWERLEVEL9K_VCS_SHORTEN_DELIMITER$(echo "${branch_name: -$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")"
+ ;;
+ truncate_from_right)
+ hook_com[branch]="$(echo "${branch_name:0:$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")$POWERLEVEL9K_VCS_SHORTEN_DELIMITER"
+ ;;
+ esac
+ fi
+ fi
+
hook_com[branch]="$(print_icon 'VCS_BRANCH_ICON')${hook_com[branch]}"
# Always show the remote
#if [[ -n ${remote} ]] ; then