1
1

help: do not break a line inside the 17-column keystrokes area

When the description of a keystroke starts with a very long word,
or when it does not contain any spaces at all (like for Chinese
and Japanese), do not break in the blanks before the description
but instead break IN the description, at the edge of the screen.

In other words: when wrapping a help text, do not consider blanks in
the first 17 columns to be blanks (unless it is a continuation line).

This fixes https://savannah.gnu.org/bugs/?57987.

Bug existed since version 4.8, commit 1486f32d,
when the wrapping of help texts was improved.
Этот коммит содержится в:
Benno Schulenberg 2020-03-15 13:44:06 +01:00
родитель 09042f5499
Коммит 16f17f3f1b

Просмотреть файл

@ -1368,9 +1368,10 @@ ssize_t break_line(const char *textstart, ssize_t goal, bool snap_at_nl)
while (*pointer != '\0' && is_blank_char(pointer))
pointer += advance_over(pointer, &column);
/* Find the last blank that does not overshoot the target column. */
/* Find the last blank that does not overshoot the target column.
* When treating a help text, do not break in the keystrokes area. */
while (*pointer != '\0' && ((ssize_t)column <= goal)) {
if (is_blank_char(pointer))
if (is_blank_char(pointer) && (!inhelp || column > 17 || goal < 32))
lastblank = pointer;
#ifdef ENABLE_HELP
else if (snap_at_nl && *pointer == '\n') {