From 33b0000675eb16b77d0b7db9e8d40afdb0aa41e5 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Wed, 16 Dec 2020 23:29:45 -0600 Subject: [PATCH] Uplift the {bar}/{th-bar} code, i.a.: add a non-UTF8 fallback character. --- zinit.zsh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zinit.zsh b/zinit.zsh index 724e22ad..d496dc24 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -1902,12 +1902,22 @@ builtin setopt noaliases # ]]] # FUNCTION: .zinit-formatter-bar. [[[ .zinit-formatter-bar() { - REPLY=$ZINIT[col-bar]${(l:COLUMNS-1::─:):-}$ZINIT[col-rst] + .zinit-formatter-bar-util ─ bar } # ]]] # FUNCTION: .zinit-formatter-th-bar. [[[ .zinit-formatter-th-bar() { - REPLY=$ZINIT[col-th-bar]${(l:COLUMNS-1::━:):-}$ZINIT[col-rst] + .zinit-formatter-bar-util ━ th-bar +} +# FUNCTION: .zinit-formatter-bar-util. [[[ +.zinit-formatter-bar-util() { + if [[ $LANG == (#i)*utf-8* ]]; then + ch=$1 + else + ch=- + fi + + REPLY=$ZINIT[col-$2]${(pl:COLUMNS-1::$ch:):-}$ZINIT[col-rst] } # ]]] # FUNCTION: .zinit-formatter-url. [[[