commit 9bb64fccefdee6b241f402ecf1385a6e41f60d61
parent 6e3adf31b80a8167c26ef399a2191fed10e85e30
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 13 Jan 2017 17:47:55 +0100
tweaks: chuck some obscuring debugging stuff
Diffstat:
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2675,6 +2675,7 @@ int update_line(filestruct *fileptr, size_t index)
if (ISSET(SOFTWRAP)) {
filestruct *line = openfile->edittop;
+ /* Find out on which screen row the target line should be shown. */
while (line != fileptr && line != NULL) {
row += (strlenpt(line->data) / editwincols) + 1;
line = line->next;
@@ -2697,10 +2698,6 @@ int update_line(filestruct *fileptr, size_t index)
/* Expand the line, replacing tabs with spaces, and control
* characters with their displayed forms. */
converted = display_string(fileptr->data, from_col, editwincols, TRUE);
-#ifdef DEBUG
- if (ISSET(SOFTWRAP) && strlen(converted) >= editwincols - 2)
- fprintf(stderr, "update_line(): converted(1) line = %s\n", converted);
-#endif
/* Draw the line. */
edit_draw(fileptr, converted, row, from_col);
@@ -2719,20 +2716,13 @@ int update_line(filestruct *fileptr, size_t index)
for (from_col += editwincols; from_col <= full_length &&
row < editwinrows - 1; from_col += editwincols) {
- row++;
-#ifdef DEBUG
- fprintf(stderr, "update_line(): softwrap code, moving to %d column %lu\n", row, (unsigned long)from_col);
-#endif
/* First, blank out the row. */
- blank_row(edit, row, 0, COLS);
+ blank_row(edit, ++row, 0, COLS);
/* Expand the line, replacing tabs with spaces, and control
* characters with their displayed forms. */
converted = display_string(fileptr->data, from_col, editwincols, TRUE);
-#ifdef DEBUG
- if (ISSET(SOFTWRAP) && strlen(converted) >= editwincols - 2)
- fprintf(stderr, "update_line(): converted(2) line = %s\n", converted);
-#endif
+
/* Draw the line. */
edit_draw(fileptr, converted, row, from_col);
free(converted);
@@ -2740,7 +2730,7 @@ int update_line(filestruct *fileptr, size_t index)
extra_rows++;
}
}
-#endif /* !NANO_TINY */
+#endif
return extra_rows;
}