tweaks: chuck some obscuring debugging stuff
parent
6e3adf31b8
commit
9bb64fccef
18
src/winio.c
18
src/winio.c
|
@ -2675,6 +2675,7 @@ int update_line(filestruct *fileptr, size_t index)
|
||||||
if (ISSET(SOFTWRAP)) {
|
if (ISSET(SOFTWRAP)) {
|
||||||
filestruct *line = openfile->edittop;
|
filestruct *line = openfile->edittop;
|
||||||
|
|
||||||
|
/* Find out on which screen row the target line should be shown. */
|
||||||
while (line != fileptr && line != NULL) {
|
while (line != fileptr && line != NULL) {
|
||||||
row += (strlenpt(line->data) / editwincols) + 1;
|
row += (strlenpt(line->data) / editwincols) + 1;
|
||||||
line = line->next;
|
line = line->next;
|
||||||
|
@ -2697,10 +2698,6 @@ int update_line(filestruct *fileptr, size_t index)
|
||||||
/* Expand the line, replacing tabs with spaces, and control
|
/* Expand the line, replacing tabs with spaces, and control
|
||||||
* characters with their displayed forms. */
|
* characters with their displayed forms. */
|
||||||
converted = display_string(fileptr->data, from_col, editwincols, TRUE);
|
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. */
|
/* Draw the line. */
|
||||||
edit_draw(fileptr, converted, row, from_col);
|
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 &&
|
for (from_col += editwincols; from_col <= full_length &&
|
||||||
row < editwinrows - 1; from_col += editwincols) {
|
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. */
|
/* 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
|
/* Expand the line, replacing tabs with spaces, and control
|
||||||
* characters with their displayed forms. */
|
* characters with their displayed forms. */
|
||||||
converted = display_string(fileptr->data, from_col, editwincols, TRUE);
|
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. */
|
/* Draw the line. */
|
||||||
edit_draw(fileptr, converted, row, from_col);
|
edit_draw(fileptr, converted, row, from_col);
|
||||||
free(converted);
|
free(converted);
|
||||||
|
@ -2740,7 +2730,7 @@ int update_line(filestruct *fileptr, size_t index)
|
||||||
extra_rows++;
|
extra_rows++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif
|
||||||
|
|
||||||
return extra_rows;
|
return extra_rows;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue