nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 98b029cf3e67ca6efd9f1a942298a640523adfe5
parent c0fa3f04b1f32e5c7b5e996eb9a78f777acc2edb
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sat, 21 Jan 2017 11:25:39 -0600

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.

Diffstat:
Msrc/winio.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git 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;