+2014-02-26 Benno Schulenberg <bensberg@justemail.net>
+ * src/move.c (do_down), src/winio.c (edit_scroll) - Scroll an
+ extra amount when softwrap is on and the current line would
+ otherwise run off the screen, and recalculate maxrows after
+ each scroll. Solves bug #27550 reported by Hannes Schueller.
+
2014-02-25 Benno Schulenberg <bensberg@justemail.net>
* NEWS - Fix some typos and wordings, and rewrap a few lines.
* src/global.c - Correcting some translator comments, removal
)
{
bool onlastline = FALSE;
+ int extra = 0;
/* If we're at the bottom of the file, get out. */
if (openfile->current == openfile->filebot)
if (ISSET(SOFTWRAP)) {
if (openfile->current->lineno - openfile->edittop->lineno >= maxrows)
onlastline = TRUE;
+ /* Compute the extra amount to scroll when the current line is overlong. */
+ extra = (strlenpt(openfile->current->data) / COLS + openfile->current_y + 2 - editwinrows);
}
/* If scroll_only is FALSE and if we're on the first line of the
editwinrows / 2 + 1);
edit_refresh_needed = TRUE;
+ } else if (extra > 0) {
+ edit_scroll(DOWN_DIR, extra);
+ edit_refresh_needed = TRUE;
}
/* If we're above the last line of the edit window, update the line
* we were on before and the line we're on now. The former needs to