tweaks: rename a function, away from using an abbreviation

Also reshuffle a tiny fragment of code.
master
Benno Schulenberg 2021-11-17 11:01:37 +01:00
parent e35b6636ab
commit c772e1cb6b
4 changed files with 7 additions and 8 deletions

View File

@ -1512,7 +1512,7 @@ void shortcut_init(void)
#ifndef NANO_TINY
/* Return the textual description that corresponds to the given flag. */
const char *flagtostr(int flag)
const char *epithet_of_flag(int flag)
{
switch (flag) {
case NO_HELP:

View File

@ -235,7 +235,7 @@ void help_init(void)
for (s = sclist; s != NULL; s = s->next)
if (s->func == do_toggle)
allocsize += strlen(_(flagtostr(s->toggle))) + onoff_len + 9;
allocsize += strlen(_(epithet_of_flag(s->toggle))) + onoff_len + 9;
}
#endif
@ -303,7 +303,7 @@ void help_init(void)
for (s = sclist; s != NULL; s = s->next)
if (s->toggle && s->ordinal == counter) {
ptr += sprintf(ptr, "%s\t\t %s %s\n", (s->menus & MMAIN ? s->keystr : ""),
_(flagtostr(s->toggle)), _("enable/disable"));
_(epithet_of_flag(s->toggle)), _("enable/disable"));
/* Add a blank like between two groups. */
if (s->toggle == NO_SYNTAX)
ptr += sprintf(ptr, "\n");

View File

@ -1077,6 +1077,8 @@ void toggle_this(int flag)
case ZERO:
window_init();
draw_all_subwindows();
if (flag == ZERO)
return;
break;
case CONSTANT_SHOW:
if (ISSET(ZERO) || LINES == 1) {
@ -1114,9 +1116,6 @@ void toggle_this(int flag)
#endif
}
if (flag == ZERO)
return;
if (ISSET(STATEFLAGS) && !ISSET(ZERO) && (flag == AUTOINDENT ||
flag == BREAK_LONG_LINES || flag == SOFTWRAP)) {
if (ISSET(MINIBAR))
@ -1131,7 +1130,7 @@ void toggle_this(int flag)
if (flag == NO_HELP || flag == NO_SYNTAX)
enabled = !enabled;
statusline(REMARK, "%s %s", _(flagtostr(flag)),
statusline(REMARK, "%s %s", _(epithet_of_flag(flag)),
enabled ? _("enabled") : _("disabled"));
}
#endif /* !NANO_TINY */

View File

@ -323,7 +323,7 @@ functionptrtype interpret(int *keycode);
#endif
int keycode_from_string(const char *keystring);
void shortcut_init(void);
const char *flagtostr(int flag);
const char *epithet_of_flag(int flag);
/* Some functions in help.c. */
#ifdef ENABLE_HELP