From 7bdf5f11685ab7442f7474965018afac0d6986b2 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 17:19:03 +1100 Subject: [PATCH] Fix bug with block chars --- neofetch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index 77305e67..e6151acc 100755 --- a/neofetch +++ b/neofetch @@ -2091,6 +2091,11 @@ getascii() { ascii_strip="${ascii_strip//'\\'/ }" ascii_strip="${ascii_strip//'\'}" + # Workaround for calculating length of block chars + # when locale is set to 'C' + block_char="█" + [ "${#block_char}" == 3 ] && ascii_strip="${ascii_strip//${block_char}/ }" + # Get lines/columns of the ascii file. ascii_length=0 lines=1 @@ -2099,11 +2104,6 @@ getascii() { lines="$((lines+=1))" done <<< "$ascii_strip" - # Workaround for calculating length of block chars - # when locale is set to 'C' - block_char="█" - [ "${#block_char}" == 3 ] && ascii_length="$((ascii_length / 3 + 2))" - padding="\033[$((ascii_length + gap))C" printf "%b%s" "$print" export LC_ALL=C