From a564b19aeb546a5c8b9726267f4944bf3d5a629c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 00:42:34 +1100 Subject: [PATCH] Fix cursor bugs and use yoffset in calculations --- neofetch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index 9f862f8b..db55e25a 100755 --- a/neofetch +++ b/neofetch @@ -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 } # }}}