help: make the column for the first keystroke a little wider

To make room for the "M-Right" that is coming in the next commit --
seven characters are needed instead of six.
master
Benno Schulenberg 2019-05-13 11:07:21 +02:00
parent 0ebfd54e17
commit e26cbdd6cd
1 changed files with 7 additions and 6 deletions

View File

@ -468,7 +468,7 @@ void help_init(void)
* plus one or two \n's. */ * plus one or two \n's. */
for (f = allfuncs; f != NULL; f = f->next) for (f = allfuncs; f != NULL; f = f->next)
if (f->menus & currmenu) if (f->menus & currmenu)
allocsize += (16 * MAXCHARLEN) + strlen(_(f->help)) + 2; allocsize += (17 * MAXCHARLEN) + strlen(_(f->help)) + 2;
#ifndef NANO_TINY #ifndef NANO_TINY
/* If we're on the main list, we also count the toggle help text. /* If we're on the main list, we also count the toggle help text.
@ -511,18 +511,19 @@ void help_init(void)
/* 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 (++tally == 1) { if (++tally == 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. */
ptr += (strstr(s->keystr, "\xE2") != NULL ? 8 : 6); ptr += (strstr(s->keystr, "\xE2") != NULL ? 9 : 7);
} else { } else {
ptr += sprintf(ptr, "(%s)\t", s->keystr); sprintf(ptr, "(%s) ", s->keystr);
ptr += (strstr(s->keystr, "\xE2") != NULL ? 12 : 10);
break; break;
} }
} }
} }
if (tally == 0) if (tally == 0)
ptr += sprintf(ptr, "\t\t"); ptr += sprintf(ptr, "\t\t ");
else if (tally == 1) else if (tally == 1)
ptr += 10; ptr += 10;
@ -547,7 +548,7 @@ void help_init(void)
counter++; counter++;
for (s = sclist; s != NULL; s = s->next) for (s = sclist; s != NULL; s = s->next)
if (s->toggle && s->ordinal == counter) { if (s->toggle && s->ordinal == counter) {
ptr += sprintf(ptr, "%s\t\t%s %s\n", (s->menus == MMAIN ? s->keystr : ""), ptr += sprintf(ptr, "%s\t\t %s %s\n", (s->menus == MMAIN ? s->keystr : ""),
_(flagtostr(s->toggle)), _("enable/disable")); _(flagtostr(s->toggle)), _("enable/disable"));
if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES) if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES)
ptr += sprintf(ptr, "\n"); ptr += sprintf(ptr, "\n");