softwrap: scroll 'enough' whenever it surpasses 'amount'

This fixes https://savannah.gnu.org/bugs/?49086.
master
Benno Schulenberg 2016-09-14 12:40:58 +02:00
parent fc9c7b4917
commit 97f6ae5267
1 changed files with 3 additions and 2 deletions

View File

@ -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