tweaks: slightly streamline the search for a possible wrapping point
That is, elide an 'if' for the it-is-a-blank case.
Этот коммит содержится в:
родитель
d30ca576b7
Коммит
178dd9181f
11
src/text.c
11
src/text.c
@ -1562,13 +1562,14 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
|
|||||||
|
|
||||||
/* Find the last blank that does not overshoot the target column. */
|
/* Find the last blank that does not overshoot the target column. */
|
||||||
while (*line != '\0' && ((ssize_t)column <= goal)) {
|
while (*line != '\0' && ((ssize_t)column <= goal)) {
|
||||||
if (is_blank_mbchar(line) || (snap_at_nl && *line == '\n')) {
|
if (is_blank_mbchar(line))
|
||||||
lastblank = index;
|
lastblank = index;
|
||||||
|
#ifdef ENABLE_HELP
|
||||||
if (*line == '\n')
|
else if (snap_at_nl && *line == '\n') {
|
||||||
break;
|
lastblank = index;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
charlen = advance_over(line, &column);
|
charlen = advance_over(line, &column);
|
||||||
line += charlen;
|
line += charlen;
|
||||||
index += charlen;
|
index += charlen;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user