softwrap: account for firstcolumn in reset_cursor()

When counting rows in softwrap mode, reset_cursor() should compensate for
the number of softwrapped chunks that edittop takes up before firstcolumn.
master
David Lawrence Ramsey 2017-01-21 11:25:39 -06:00 committed by Benno Schulenberg
parent c0fa3f04b1
commit 98b029cf3e
1 changed files with 2 additions and 0 deletions

View File

@ -2268,6 +2268,8 @@ void reset_cursor(void)
if (ISSET(SOFTWRAP)) {
filestruct *line = openfile->edittop;
row -= (openfile->firstcolumn / editwincols);
/* Calculate how many rows the lines from edittop to current use. */
while (line != NULL && line != openfile->current) {
row += strlenpt(line->data) / editwincols + 1;