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