[PR] dylanaraps/neofetch#2042 from angelofallars - BUGFIX: fix offset bug w/ col_offset and many color blocks #2037

Upstream PR: https://github.com/dylanaraps/neofetch/pull/2042
Thanks to @angelofallars

Co-authored-by: Angelo Fallaria <ba.fallaria@gmail.com>
This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-07-31 15:13:32 -04:00
commit 3ff1e38e0b

View file

@ -4086,18 +4086,21 @@ get_cols() {
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}nl}"
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}nl}"
# Determine the horizontal offset of the blocks.
case $col_offset in
"auto") block_offset="$text_padding" ;;
*) block_offset="$col_offset" ;;
esac
# Add newlines to the string.
cols=${cols%%nl}
cols=${cols//nl/
[${text_padding}C${zws}}
[${block_offset}C${zws}}
# Add block height to info height.
((info_height+=block_range[1]>7?block_height+2:block_height+1))
case $col_offset in
"auto") printf '\n\e[%bC%b\n' "$text_padding" "${zws}${cols}" ;;
*) printf '\n\e[%bC%b\n' "$col_offset" "${zws}${cols}" ;;
esac
printf '\n\e[%bC%b\n' "$block_offset" "${zws}${cols}"
fi
unset -v blocks blocks2 cols