46195d3aa7b21c2477e3ddacd57ac82856b3be76

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix: fix svn branch output in themes: apple, gentoo, kolo, zhann (#10751)

Fixes #10751

Diff

  1diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
  2index 95e6249fa897a46ab12c80b9b3f18b99dc1f0ba7..0c183258eb51b2d335f8e52bda882fbe2ed9529d 100644
  3--- a/themes/apple.zsh-theme
  4+++ b/themes/apple.zsh-theme
  5@@ -2,27 +2,23 @@ function toon {
  6   echo -n ""
  7 }
  8 
  9-get_git_dirty() {
 10-  git diff --quiet || echo '*'
 11-}
 12-
 13 autoload -Uz vcs_info
 14 zstyle ':vcs_info:*' check-for-changes true
 15 zstyle ':vcs_info:*' unstagedstr '%F{red}*'   # display this when there are unstaged changes
 16 zstyle ':vcs_info:*' stagedstr '%F{yellow}+'  # display this when there are staged changes
 17-zstyle ':vcs_info:*' actionformats \
 18-    '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
 19-zstyle ':vcs_info:*' formats       \
 20-    '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f '
 21-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
 22+zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
 23+zstyle ':vcs_info:*' formats '%F{5}[%F{2}%b%c%u%F{5}]%f '
 24+zstyle ':vcs_info:svn:*' branchformat '%b'
 25+zstyle ':vcs_info:svn:*' actionformats '%F{5}[%F{2}%b%F{1}:%F{3}%i%F{3}|%F{1}%a%c%u%F{5}]%f '
 26+zstyle ':vcs_info:svn:*' formats '%F{5}[%F{2}%b%F{1}:%F{3}%i%c%u%F{5}]%f '
 27 zstyle ':vcs_info:*' enable git cvs svn
 28 
 29 theme_precmd () {
 30-    vcs_info
 31+  vcs_info
 32 }
 33 
 34 setopt prompt_subst
 35 PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
 36 
 37 autoload -U add-zsh-hook
 38-add-zsh-hook precmd theme_precmd
 39+add-zsh-hook precmd theme_precmd
 40diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
 41index 7ac46103602ce8eeaacbeeac81cc6f7e5afeb62f..b1aef21df41895052ad59994474c4c650e32c939 100644
 42--- a/themes/gentoo.zsh-theme
 43+++ b/themes/gentoo.zsh-theme
 44@@ -6,7 +6,9 @@ zstyle ':vcs_info:*' unstagedstr '%F{red}*'   # display this when there are unst
 45 zstyle ':vcs_info:*' stagedstr '%F{yellow}+'  # display this when there are staged changes
 46 zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f '
 47 zstyle ':vcs_info:*' formats '%F{5}(%F{2}%b%c%u%m%F{5})%f '
 48-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
 49+zstyle ':vcs_info:svn:*' branchformat '%b'
 50+zstyle ':vcs_info:svn:*' actionformats '%F{5}(%F{2}%b%F{1}:%{3}%i%F{3}|%F{1}%a%c%u%m%F{5})%f '
 51+zstyle ':vcs_info:svn:*' formats '%F{5}(%F{2}%b%F{1}:%F{3}%i%c%u%m%F{5})%f '
 52 zstyle ':vcs_info:*' enable git cvs svn
 53 zstyle ':vcs_info:git*+set-message:*' hooks untracked-git
 54 
 55diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
 56index 51b0af724aff06735f0aef28381d9787e03f6e94..e07be75c48d3447370c32e94c5581cd2afe54d62 100644
 57--- a/themes/kolo.zsh-theme
 58+++ b/themes/kolo.zsh-theme
 59@@ -3,16 +3,18 @@ autoload -Uz vcs_info
 60 zstyle ':vcs_info:*' stagedstr '%F{green}●'
 61 zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
 62 zstyle ':vcs_info:*' check-for-changes true
 63-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
 64+zstyle ':vcs_info:svn:*' branchformat '%b'
 65+zstyle ':vcs_info:svn:*' formats ' [%b%F{1}:%F{11}%i%c%u%B%F{green}]'
 66 zstyle ':vcs_info:*' enable git svn
 67+
 68 theme_precmd () {
 69-    if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
 70-        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
 71-    } else {
 72-        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
 73-    }
 74+  if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
 75+    zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{green}]'
 76+  else
 77+    zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
 78+  fi
 79 
 80-    vcs_info
 81+  vcs_info
 82 }
 83 
 84 setopt prompt_subst
 85diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
 86index 27597ec6ce6de3720b58e722c6d3a1f108867285..a00650ac81d6b4b00de095824075c1b116801d1e 100644
 87--- a/themes/zhann.zsh-theme
 88+++ b/themes/zhann.zsh-theme
 89@@ -3,16 +3,18 @@ autoload -Uz vcs_info
 90 zstyle ':vcs_info:*' stagedstr '%F{green}●'
 91 zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
 92 zstyle ':vcs_info:*' check-for-changes true
 93-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
 94+zstyle ':vcs_info:svn:*' branchformat '%b'
 95+zstyle ':vcs_info:svn:*' formats ' [%b%F{1}:%F{11}%i%c%u%B%F{green}]'
 96 zstyle ':vcs_info:*' enable git svn
 97+
 98 theme_precmd () {
 99-    if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
100-        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
101-    } else {
102-        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
103-    }
104+  if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
105+    zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{green}]'
106+  else
107+    zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
108+  fi
109 
110-    vcs_info
111+  vcs_info
112 }
113 
114 setopt prompt_subst