From 60ae71bf3a4528362a3f78b99cfa74dac4181e18 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 18 Feb 2020 15:35:44 +0100 Subject: [PATCH] softwrap: when typing goes beyond the bottom row, scroll just one row This fixes https://savannah.gnu.org/bugs/?57851. Bug existed since version 2.8.0, when scrolling per soft-wrapped chunk was made possible. --- src/nano.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index 2e2e119c..6c7995eb 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1714,8 +1714,10 @@ void inject(char *burst, size_t count) if (ISSET(SOFTWRAP) && refresh_needed == FALSE && (number_of_chunks_in(openfile->current) != old_amount || (openfile->current_y == editwinrows - 1 && - chunk_for(xplustabs(), openfile->current) != original_row))) + chunk_for(xplustabs(), openfile->current) > original_row))) { refresh_needed = TRUE; + focusing = FALSE; + } #endif openfile->placewewant = xplustabs();