diff --git a/ChangeLog b/ChangeLog index 1bf5ee5d0cf16cffda194d6d7c479a596292ae90..570d0331d96853f4c7377e2ba93b60f5b2bcbf17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ in the list of shortcuts is enough. * src/global.c (shortcut_init): Put left/right in normal order. * src/global.c (shortcut_init): List function key after meta key. + * src/help.c (help_init): Show just two shortcuts per function -- + only three functions showed three, but who has an F13, F14, F15? 2014-04-21 Benno Schulenberg <bensberg@justemail.net> * doc/syntax/nanorc.nanorc: There is no F0 key. diff --git a/src/help.c b/src/help.c index 80f1374e7c57bc3b2ae270b2037754b89de434f5..5f20e01108d87da96ac8a077110b8887b51e6c10 100644 --- a/src/help.c +++ b/src/help.c @@ -423,11 +423,10 @@ void help_init(void) if (!f->desc || !strcmp(f->desc, "")) continue; - /* Let's just try and use the first 3 shortcuts from the new - * struct... */ + /* Let's simply show the first two shortcuts from the list. */ for (s = sclist, scsfound = 0; s != NULL; s = s->next) { - if (scsfound == 3) + if (scsfound == 2) continue; if (s->type == RAWINPUT) @@ -438,18 +437,21 @@ void help_init(void) if (s->scfunc == f->scfunc) { scsfound++; - - if (scsfound == 1) - ptr += sprintf(ptr, "%s", s->keystr); - else - ptr += sprintf(ptr, "(%s)", s->keystr); - *(ptr++) = '\t'; + /* 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); + ptr += 6; + } else { + ptr += sprintf(ptr, "(%s)\t", s->keystr); + } } } - /* Pad with tabs if we didn't find 3. */ - for (; scsfound < 3; scsfound++) { - *(ptr++) = '\t'; - } + + if (scsfound == 0) + ptr += sprintf(ptr, "\t\t"); + else if (scsfound == 1) + ptr += 10; /* The shortcut's help text. */ ptr += sprintf(ptr, "%s\n", _(f->help)); @@ -463,7 +465,7 @@ void help_init(void) if (currmenu == MMAIN) for (s = sclist; s != NULL; s = s->next) if (s->scfunc == do_toggle_void) - ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n", + ptr += sprintf(ptr, "(%s)\t\t%s %s\n", s->keystr, _(flagtostr(s->toggle)), _("enable/disable")); #ifndef DISABLE_NANORC