commit 97f6ae526702de3d3698d212a7aa9a509590c80f
parent fc9c7b4917011f6ee82e0369e8284f4a965345d8
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 14 Sep 2016 12:40:58 +0200
softwrap: scroll 'enough' whenever it surpasses 'amount'
This fixes https://savannah.gnu.org/bugs/?49086.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/move.c b/src/move.c
@@ -482,11 +482,12 @@ void do_down(bool scroll_only)
/* Reduce the amount when there are overlong lines at the top. */
for (enough = 1; enough < amount; enough++) {
amount -= strlenpt(topline->data) / COLS;
- if (amount <= 0) {
+ if (amount > 0)
+ topline = topline->next;
+ if (amount < enough) {
amount = enough;
break;
}
- topline = topline->next;
}
}
#endif