From 572755a6972d544df0da116df506e2f9714cdfd1 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 19 Jul 2013 15:54:11 +0200 Subject: [Internals] factorize «subscript number» MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01_Internal.zsh | 10 ++++++---- 1 file 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 -- cgit v1.2.3