diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-07-19 15:54:11 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-07-19 15:54:11 +0200 |
commit | 572755a6972d544df0da116df506e2f9714cdfd1 (patch) | |
tree | 85b9edc60b27a77ae6c987835e259312fca342c5 | |
parent | 059fb81625ec029caec9ade1359e42e1a9296cf2 (diff) |
[Internals] factorize «subscript number»
-rw-r--r-- | 01_Internal.zsh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/01_Internal.zsh b/01_Internal.zsh index 557a525..0eb2bfc 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -253,20 +253,22 @@ __get_git_branch () if [ $_ahead -gt 0 ] then my_git_branch+=$C_$_gcl_colors[cached]$_C"↑" - [ $_ahead -gt 1 ] && my_git_branch+="₊$(echo $_ahead | \ - sed 's/0/₀/g;s/1/₁/g;s/2/₂/g;s/3/₃/g;s/4/₄/g;s/5/₅/g;s/6/₆/g;s/7/₇/g;s/8/₈/g;s/9/₉/g')" + [ $_ahead -gt 1 ] && my_git_branch+="₊$(echo $_ahead | _subscript_number)" fi if [ $_behind -gt 0 ] then my_git_branch+=$C_$_prompt_colors[bold_generic]$_C"↓" - [ $_behind -gt 1 ] && my_git_branch+="₊$(echo $_behind | \ - sed 's/0/₀/g;s/1/₁/g;s/2/₂/g;s/3/₃/g;s/4/₄/g;s/5/₅/g;s/6/₆/g;s/7/₇/g;s/8/₈/g;s/9/₉/g')" + [ $_behind -gt 1 ] && my_git_branch+="₊$(echo $_behind | _subscript_number)" fi fi echo $my_git_branch } +_subscript_number() { + sed 's/0/₀/g;s/1/₁/g;s/2/₂/g;s/3/₃/g;s/4/₄/g;s/5/₅/g;s/6/₆/g;s/7/₇/g;s/8/₈/g;s/9/₉/g' +} + __get_guilt_series () { # Guilt |