nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 5cfb74650d3ae847a23ee37669292b9b58e502ae
parent 8cd6aa0a322432d400d2b5d8203aef6a1b5c282f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 26 Jun 2019 12:17:29 +0200

scrolling: don't overscroll when the edit window has just one row

If the edit window consists of a single row, then the do_down() call
has already brought the desired line or chunk into view -- no attempt
should then be made to scroll the screen further.

This fixes https://savannah.gnu.org/bugs/?56553.

Bug existed since version 2.9.6, commit 0d9080a2.

Diffstat:
Msrc/move.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/move.c b/src/move.c @@ -554,12 +554,12 @@ void do_scroll_down(void) if (openfile->current_y == 0) do_down(); - if (openfile->edittop->next != NULL + if (editwinrows > 1 && (openfile->edittop->next != NULL #ifndef NANO_TINY || chunk_for(openfile->firstcolumn, openfile->edittop) < number_of_chunks_in(openfile->edittop) #endif - ) + )) edit_scroll(FORWARD); } #endif