From 3d8cd65b1b16ae121c8c875aaadd9e3d7ee28ed3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 15 Mar 2020 19:01:07 +0100 Subject: [PATCH] tweaks: reshuffle a condition, for compactness --- src/winio.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/winio.c b/src/winio.c index aa3fd3ef..5ff2cff2 100644 --- 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; }