From 8091d0a5743ba8440ce90972901ac8bfbe1a39e6 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 28 Mar 2017 19:24:37 +0200 Subject: [PATCH] tweaks: simplify and correct a computation The leftedge variable is a column number, not an x position. --- src/winio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index cbe16d88..4285c9be 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2923,7 +2923,7 @@ void edit_scroll(scroll_dir direction, int nrows) /* If the first blank row is in the middle of a softwrapped line, * compensate for the earlier onscreen chunks of that line. */ if (ISSET(SOFTWRAP) && i == nrows && line != openfile->edittop) - i += strnlenpt(line->data, leftedge) / editwincols; + i += leftedge / editwincols; #endif i -= update_line(line, (line == openfile->current) ? openfile->current_x : 0);