justification: when leading whitespace exceeds fill width, wrap anyway
Pico wraps at the last blank character before or on the target column; if there is no such blank, then it will wrap at the first blank *after* the target column -- when it can wrap, it will wrap. Nano should do the same (and judging from the comments, it intended to do the same), instead of turning the paragraph into a single unwrapped line. This fixes https://savannah.gnu.org/bugs/?53986.master
parent
b9f533a69e
commit
a832f33291
|
@ -1738,7 +1738,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
|
|||
/* The length of the current character, in bytes. */
|
||||
|
||||
/* Find the last blank that does not overshoot the target column. */
|
||||
while (*line != '\0' && column <= goal) {
|
||||
while (*line != '\0' && ((ssize_t)column <= goal)) {
|
||||
if (is_blank_mbchar(line) || (snap_at_nl && *line == '\n')) {
|
||||
lastblank = index;
|
||||
|
||||
|
@ -1752,7 +1752,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
|
|||
}
|
||||
|
||||
/* If the whole line displays shorter than goal, we're done. */
|
||||
if (column <= goal)
|
||||
if ((ssize_t)column <= goal)
|
||||
return index;
|
||||
|
||||
#ifdef ENABLE_HELP
|
||||
|
|
Loading…
Reference in New Issue