From 9da23799ffa0c3c800b2db864cc986580120596e Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 26 Nov 2020 17:31:29 +0100 Subject: [PATCH] tweaks: reshuffle a fragment of code, for clarity --- src/winio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/winio.c b/src/winio.c index cbc1f36d..5712e983 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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++; }