Fix redraw if cursor is not at the bottom - scroll - scrollbackbuffer program for st
 (HTM) git clone git://git.suckless.org/scroll
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 8eccc7198b45b63e990c56809015140f4380f272
 (DIR) parent a4faed60e37174f43dce47e099a8b55b1f1a5556
 (HTM) Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
       Date:   Sat, 18 Apr 2020 23:05:09 +0200
       
       Fix redraw if cursor is not at the bottom
       
       Diffstat:
         M scroll.c                            |       6 ++++--
       
       1 file changed, 4 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/scroll.c b/scroll.c
       @@ -259,9 +259,9 @@ redraw()
        
                getcursorposition(&x, &y);
        
       -        /* wind back bottom pointer by one page */
       +        /* wind back bottom pointer by shown history */
                for (; bottom != NULL && TAILQ_NEXT(bottom, entries) != NULL &&
       -            rows < x - 1; rows++)
       +            rows < x - 2; rows++)
                        bottom = TAILQ_NEXT(bottom, entries);
        
                if (rows == 0)
       @@ -282,6 +282,8 @@ redraw()
                        bottom = TAILQ_PREV(bottom, tailhead, entries);
                        write(STDOUT_FILENO, bottom->buf, bottom->size);
                }
       +        /* add new line in front of the shell prompt */
       +        write(STDOUT_FILENO, "\n", 1);
        }
        
        void