Fix yoffset bug

This commit is contained in:
Dylan Araps 2016-10-22 01:05:47 +11:00
parent 466a61b19e
commit b12e5b1f56
1 changed files with 5 additions and 3 deletions

View File

@ -2907,15 +2907,17 @@ kdeconfigdir() {
dynamicprompt() { dynamicprompt() {
# Calculate image height in terminal cells. # Calculate image height in terminal cells.
# The '+ 1' adds a gap between the prompt and the content. # The '+ 1' adds a gap between the prompt and the content.
[ "$image" != "ascii" ] && \ if [ "$image" != "ascii" ]; then
lines="$((${height:-1} / ${font_height:-1} + 1))" lines="$((${height:-1} / ${font_height:-1} + 2))"
cursor_yoffset="$((${yoffset:-1} / ${font_height:-1}))"
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
# based on the info height instead of the ascii/image height. # based on the info height instead of the ascii/image height.
if [ "${lines:-0}" -lt "${info_height:-0}" ]; then if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
lines="0" lines="0"
else else
lines="$((lines - info_height + $((${yoffset:-1} / ${font_height:-1}))))" lines="$((lines - info_height + cursor_yoffset - 1))"
fi fi
# Set the prompt location # Set the prompt location