Commit 09a4ac13 authored by Dylan Araps's avatar Dylan Araps

Simplify cursor positioning

parent d09cf587
...@@ -2962,11 +2962,9 @@ dynamicprompt() { ...@@ -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() { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment