mirror of git://git.sv.gnu.org/nano.git
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.
This commit is contained in:
parent
09042f5499
commit
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') {
|
||||
|
|
Loading…
Reference in New Issue