diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2016-04-19 19:13:00 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2016-04-19 19:13:00 +0300 |
commit | fb1dae68e9c76487eae937c35b9103b5e77d0716 (patch) | |
tree | a24ffe7faa0448781e15bbf3dd8240374aa1720d /powerlevel9k.zsh-theme | |
parent | 154181ffc2830445c30eed74949e700ad2cd5a2a (diff) | |
parent | 7b2e995299175a8d2e573413975ff8da43b0a9a2 (diff) |
Merge branch 'vcs-tag-display' into next
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 7da17f99..ed1c49cb 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -815,7 +815,14 @@ prompt_todo() { # VCS segment: shows the state of your repository, if you are in a folder under # version control set_default POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND "red" +# Default: Just display the first 8 characters of our changeset-ID. +set_default POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH "8" prompt_vcs() { + if [[ -n "$POWERLEVEL9K_CHANGESET_HASH_LENGTH" ]]; then + POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH="$POWERLEVEL9K_CHANGESET_HASH_LENGTH" + fi + + # Load VCS_INFO autoload -Uz vcs_info VCS_WORKDIR_DIRTY=false @@ -832,13 +839,7 @@ prompt_vcs() { VCS_CHANGESET_PREFIX='' if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then - # Default: Just display the first 12 characters of our changeset-ID. - local VCS_CHANGESET_HASH_LENGTH=12 - if [[ -n "$POWERLEVEL9K_CHANGESET_HASH_LENGTH" ]]; then - VCS_CHANGESET_HASH_LENGTH="$POWERLEVEL9K_CHANGESET_HASH_LENGTH" - fi - - VCS_CHANGESET_PREFIX="$(print_icon 'VCS_COMMIT_ICON')%0.$VCS_CHANGESET_HASH_LENGTH""i " + VCS_CHANGESET_PREFIX="$(print_icon 'VCS_COMMIT_ICON')%0.$POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH""i " fi zstyle ':vcs_info:*' enable git hg |