tweaks: reshuffle a fragment of code, for clarity

This commit is contained in:
Benno Schulenberg 2020-11-26 17:31:29 +01:00
parent 29276d1d3a
commit 9da23799ff

View File

@ -2228,12 +2228,16 @@ void bottombars(int menu)
wmove(bottomwin, 1 + index % 2, (index / 2) * itemwidth);
/* When the number is uneven, the penultimate item can be extra wide. */
/* When the number is uneven, the penultimate item can be double wide. */
if ((number % 2) == 1 && (index + 2 == number))
thiswidth += itemwidth;
post_one_key(s->keystr, _(f->desc), thiswidth +
((index < number - 2) ? 0 : COLS % itemwidth));
/* For the last two items, use also the remaining slack. */
if (index + 2 >= number)
thiswidth += COLS % itemwidth;
post_one_key(s->keystr, _(f->desc), thiswidth);
index++;
}