[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:
commit
3ff1e38e0b
1 changed files with 8 additions and 5 deletions
13
neofetch
13
neofetch
|
@ -4086,18 +4086,21 @@ get_cols() {
|
|||
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}[mnl}"
|
||||
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}[mnl}"
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue