commit 08cfdbcbdb7b574fee62377225b842bce3ef3fbe
parent 6103c47f1c7638c6661b993a3feb80872621dbde
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 8 Jan 2017 11:49:59 +0100
tweaks: don't compare a character offset with a column position
It is the misuse of "x_" to mean a column position on screen, and the
misuse of "_col" to mean a character position in a string that causes
this confusion.
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2318,7 +2318,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
if (margin > 0) {
wattron(edit, interface_color_pair[LINE_NUMBER]);
#ifndef NANO_TINY
- if (ISSET(SOFTWRAP) && from_x >= editwincols)
+ if (ISSET(SOFTWRAP) && from_x != 0)
mvwprintw(edit, line, 0, "%*s", margin - 1, " ");
else
#endif
@@ -2665,8 +2665,6 @@ void edit_draw(filestruct *fileptr, const char *converted, int
x_start = 0;
}
- assert(x_start >= 0 && x_start <= strlen(converted));
-
index = actual_x(converted, x_start);
if (paintlen > 0)