display: keep the help items aligned, by not writing too many characters

Only for the last item at the end of each of the two help lines there
are sometimes a few extra columns available.  Do not use these extra
columns also for the other help items, because apparently, when wmove()
lands in the second column of a double-width character, it does not
wipe out this character (replacing it with a space) but goes to the
next column instead, causing a misalignment of the text.

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

Bug existed since version 1.3.12, commit e806ab84.
master
Benno Schulenberg 2020-03-16 08:55:11 +01:00
parent 3d8cd65b1b
commit 56308b3256
1 changed files with 2 additions and 1 deletions

View File

@ -2318,7 +2318,8 @@ void bottombars(int menu)
wmove(bottomwin, 1 + i % 2, (i / 2) * itemwidth); wmove(bottomwin, 1 + i % 2, (i / 2) * itemwidth);
post_one_key(s->keystr, _(f->desc), itemwidth + (COLS % itemwidth)); post_one_key(s->keystr, _(f->desc), itemwidth +
((i < number - 2) ? 0 : COLS % itemwidth));
i++; i++;
} }