Commit 08cfdbcb authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 1 addition and 3 deletions
+1 -3
...@@ -2318,7 +2318,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int ...@@ -2318,7 +2318,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
if (margin > 0) { if (margin > 0) {
wattron(edit, interface_color_pair[LINE_NUMBER]); wattron(edit, interface_color_pair[LINE_NUMBER]);
#ifndef NANO_TINY #ifndef NANO_TINY
if (ISSET(SOFTWRAP) && from_x >= editwincols) if (ISSET(SOFTWRAP) && from_x != 0)
mvwprintw(edit, line, 0, "%*s", margin - 1, " "); mvwprintw(edit, line, 0, "%*s", margin - 1, " ");
else else
#endif #endif
...@@ -2665,8 +2665,6 @@ void edit_draw(filestruct *fileptr, const char *converted, int ...@@ -2665,8 +2665,6 @@ void edit_draw(filestruct *fileptr, const char *converted, int
x_start = 0; x_start = 0;
} }
assert(x_start >= 0 && x_start <= strlen(converted));
index = actual_x(converted, x_start); index = actual_x(converted, x_start);
if (paintlen > 0) if (paintlen > 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment