commit 3d8cd65b1b16ae121c8c875aaadd9e3d7ee28ed3
parent 2b6924ef6e28f4a003b9d66962a42c894e0e12e8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 15 Mar 2020 19:01:07 +0100
tweaks: reshuffle a condition, for compactness
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2823,6 +2823,8 @@ int update_softwrapped_line(linestruct *line)
/* The end column of the current chunk. */
char *converted;
/* The data of the chunk with tabs and control characters expanded. */
+ bool end_of_line = FALSE;
+ /* Becomes TRUE when the last chunk of the line has been reached. */
if (line == openfile->edittop)
from_col = openfile->firstcolumn;
@@ -2844,9 +2846,7 @@ int update_softwrapped_line(linestruct *line)
starting_row = row;
- while (row < editwinrows) {
- bool end_of_line = FALSE;
-
+ while (!end_of_line && row < editwinrows) {
to_col = get_softwrap_breakpoint(line->data, from_col, &end_of_line);
sequel_column = (end_of_line) ? 0 : to_col;
@@ -2857,9 +2857,6 @@ int update_softwrapped_line(linestruct *line)
draw_row(row++, converted, line, from_col);
free(converted);
- if (end_of_line)
- break;
-
from_col = to_col;
}