Fix cursor bugs if ascii art is taller than info

This commit is contained in:
Dylan Araps 2016-10-22 09:49:59 +11:00
parent 76772feabf
commit 0b5d25d9b5

View file

@ -2940,6 +2940,8 @@ dynamicprompt() {
if [ "$image" != "ascii" ]; then if [ "$image" != "ascii" ]; then
lines="$((${height:-1} / ${font_height:-1} + 2))" lines="$((${height:-1} / ${font_height:-1} + 2))"
cursor_yoffset="$((${yoffset:-1} / ${font_height:-1}))" cursor_yoffset="$((${yoffset:-1} / ${font_height:-1}))"
else
cursor_yoffset="0 - 4"
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
@ -2954,7 +2956,7 @@ dynamicprompt() {
[ "$image" != "off" ] && printf "\033[${lines/-*/0}B" [ "$image" != "off" ] && printf "\033[${lines/-*/0}B"
# Add some padding # Add some padding
[ "$image_backend" != "w3m" ] && \ [ "$image" == "ascii" ] && \
[ "$lines" -gt 0 ] && \ [ "$lines" -gt 0 ] && \
printf "\n\n" printf "\n\n"
} }