Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

BUGFIX: fix offset bug w/ col_offset and many color blocks #2037 #2042

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -3985,18 +3985,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
Expand Down