nano

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

commit d19169c263049078a10db7f6cbd2cad98e0bd87f
parent 4e7b92ed4c9c8f5f9cf24c89baf4fd1feee334c0
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 17 Sep 2018 20:32:48 +0200

tweaks: condense a bit of code

Diffstat:
Msrc/help.c | 11++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/help.c b/src/help.c @@ -506,21 +506,14 @@ void help_init(void) /* Let's simply show the first two shortcuts from the list. */ for (s = sclist; s != NULL; s = s->next) { - - if ((s->menus & currmenu) == 0) - continue; - - if (s->func == f->func) { + if ((s->menus & currmenu) && s->func == f->func) { scsfound++; /* Make the first column narrower (6) than the second (10), * but allow it to spill into the second, for "M-Space". */ if (scsfound == 1) { sprintf(ptr, "%s ", s->keystr); /* Unicode arrows take three bytes instead of one. */ - if (strstr(s->keystr, "\xE2") != NULL) - ptr += 8; - else - ptr += 6; + ptr += (strstr(s->keystr, "\xE2") != NULL ? 8 : 6); } else { ptr += sprintf(ptr, "(%s)\t", s->keystr); break;