From 98b029cf3e67ca6efd9f1a942298a640523adfe5 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey <pooka109@gmail.com> Date: Sat, 21 Jan 2017 11:25:39 -0600 Subject: [PATCH] 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. --- src/winio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/winio.c b/src/winio.c index 9bc45a0f..50076d14 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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; -- GitLab