tweaks: condense a fragment of code
Leave the skipping of subsequent blanks to the succeeding code.master
parent
6b8b7c9d55
commit
f3b030c8e5
13
src/text.c
13
src/text.c
|
@ -1394,19 +1394,16 @@ ssize_t break_line(const char *textstart, ssize_t goal, bool snap_at_nl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If no blank was found within the goal width, seek one after it. */
|
/* If no blank was found within the goal width, seek one after it. */
|
||||||
if (lastblank == NULL) {
|
while (lastblank == NULL) {
|
||||||
while (*pointer != '\0') {
|
if (*pointer == '\0')
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (is_blank_char(pointer))
|
if (is_blank_char(pointer))
|
||||||
lastblank = pointer;
|
lastblank = pointer;
|
||||||
else if (lastblank)
|
else
|
||||||
return (lastblank - textstart);
|
|
||||||
|
|
||||||
pointer += char_length(pointer);
|
pointer += char_length(pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Move the pointer back to the last blank, and then step beyond it. */
|
/* Move the pointer back to the last blank, and then step beyond it. */
|
||||||
pointer = lastblank + char_length(lastblank);
|
pointer = lastblank + char_length(lastblank);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue