Skip to content

Commit 3ff1e38

Browse files
[PR] dylanaraps/neofetch#2042 from angelofallars - BUGFIX: fix offset bug w/ col_offset and many color blocks #2037
Upstream PR: dylanaraps/neofetch#2042 Thanks to @angelofallars Co-authored-by: Angelo Fallaria <ba.fallaria@gmail.com>
2 parents 759373b + 8a975dc commit 3ff1e38

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

neofetch

+8-5
Original file line numberDiff line numberDiff line change
@@ -4086,18 +4086,21 @@ get_cols() {
40864086
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}nl}"
40874087
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}nl}"
40884088

4089+
# Determine the horizontal offset of the blocks.
4090+
case $col_offset in
4091+
"auto") block_offset="$text_padding" ;;
4092+
*) block_offset="$col_offset" ;;
4093+
esac
4094+
40894095
# Add newlines to the string.
40904096
cols=${cols%%nl}
40914097
cols=${cols//nl/
4092-
[${text_padding}C${zws}}
4098+
[${block_offset}C${zws}}
40934099

40944100
# Add block height to info height.
40954101
((info_height+=block_range[1]>7?block_height+2:block_height+1))
40964102

4097-
case $col_offset in
4098-
"auto") printf '\n\e[%bC%b\n' "$text_padding" "${zws}${cols}" ;;
4099-
*) printf '\n\e[%bC%b\n' "$col_offset" "${zws}${cols}" ;;
4100-
esac
4103+
printf '\n\e[%bC%b\n' "$block_offset" "${zws}${cols}"
41014104
fi
41024105

41034106
unset -v blocks blocks2 cols

0 commit comments

Comments
 (0)