Fix cursor bugs and use yoffset in calculations

This commit is contained in:
Dylan Araps 2016-10-22 00:42:34 +11:00
parent 76f7b4025e
commit a564b19aeb
1 changed files with 6 additions and 6 deletions

View File

@ -2906,25 +2906,25 @@ kdeconfigdir() {
dynamicprompt() {
# Calculate image height in terminal cells.
# The '+ 4' adds a gap between the prompt and the content.
# The '+ 1' adds a gap between the prompt and the content.
[ "$image" != "ascii" ] && \
lines="$((${height:-1} / ${font_height:-1} + 4))"
lines="$((${height:-1} / ${font_height:-1} + 1))"
# If the info is higher than the ascii/image place the prompt
# based on the info height instead of the ascii/image height.
if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
lines="0"
else
lines="$((lines - info_height - 4))"
lines="$((lines - info_height + $((${yoffset:-1} / ${font_height:-1}))))"
fi
# Set the prompt location
[ "$image" != "off" ] && printf "\033[${lines/-*/0}B"
# Add some padding if the lines are above 0
if [ "$lines" -gt 0 ]; then
# Add some padding
[ "$image_backend" != "w3m" ] && \
[ "$lines" -gt 0 ] && \
printf "\n\n"
fi
}
# }}}