Simplify cursor positioning
This commit is contained in:
parent
d09cf58790
commit
09a4ac132e
1 changed files with 3 additions and 5 deletions
8
neofetch
8
neofetch
|
@ -2962,11 +2962,9 @@ dynamicprompt() {
|
||||||
# Calculate image height in terminal cells.
|
# Calculate image height in terminal cells.
|
||||||
if [ "$image" != "ascii" ]; then
|
if [ "$image" != "ascii" ]; then
|
||||||
gettermpadding
|
gettermpadding
|
||||||
|
lines="$(((height + ${border:-0} + ${yoffset:-0}) / font_height))"
|
||||||
lines="$(((height + border) / font_height))"
|
|
||||||
cursor_yoffset="$((${yoffset:-1} / font_height))"
|
|
||||||
else
|
else
|
||||||
cursor_yoffset="0 - 2"
|
lines="$((lines-=2))"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the info is higher than the ascii/image place the prompt
|
# If the info is higher than the ascii/image place the prompt
|
||||||
|
@ -2974,7 +2972,7 @@ dynamicprompt() {
|
||||||
if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
|
if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
|
||||||
lines="-2"
|
lines="-2"
|
||||||
else
|
else
|
||||||
lines="$((lines - info_height + cursor_yoffset))"
|
lines="$((lines - info_height))"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the prompt location
|
# Set the prompt location
|
||||||
|
|
Loading…
Reference in a new issue