tweaks: improve comments and formatting in update_line()
Этот коммит содержится в:
родитель
bf0268d41d
Коммит
c67c431239
10
src/winio.c
10
src/winio.c
@ -2655,9 +2655,11 @@ void edit_draw(filestruct *fileptr, const char *converted,
|
|||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Redraw one line from the edit buffer. The line will be displayed starting
|
/* Redraw the line at fileptr. The line will be displayed so that the
|
||||||
* with fileptr->data[index]. Likely values of index are current_x or zero.
|
* character with the given index is visible -- if necessary, the line
|
||||||
* Return the number of additional rows consumed (needed for SOFTWRAP). */
|
* will be horizontally scrolled. In softwrap mode, however, the entire
|
||||||
|
* line will be displayed. Likely values of index are current_x or zero.
|
||||||
|
* Return the number of additional rows consumed (when softwrapping). */
|
||||||
int update_line(filestruct *fileptr, size_t index)
|
int update_line(filestruct *fileptr, size_t index)
|
||||||
{
|
{
|
||||||
int row = 0;
|
int row = 0;
|
||||||
@ -2720,6 +2722,7 @@ int update_line(filestruct *fileptr, size_t index)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "update_line(): softwrap code, moving to %d column %lu\n", row, (unsigned long)from_col);
|
fprintf(stderr, "update_line(): softwrap code, moving to %d column %lu\n", row, (unsigned long)from_col);
|
||||||
#endif
|
#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
|
/* Expand the line, replacing tabs with spaces, and control
|
||||||
@ -2737,6 +2740,7 @@ int update_line(filestruct *fileptr, size_t index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
return extra_rows;
|
return extra_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user