nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 9da23799ffa0c3c800b2db864cc986580120596e
parent 29276d1d3a8ff5322d6a151d69c14e33934ac577
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 26 Nov 2020 17:31:29 +0100

tweaks: reshuffle a fragment of code, for clarity

Diffstat:
Msrc/winio.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 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++; }