more 'O' tinkering
Make the code for setting up the 'O' menu's '?' entry more compact. Also adds 'skipinvert' flag for that entry but it doesn't do anthing here. I thought that it had been implemented, but aside from the flag itself, it doesn't seem to exist.
This commit is contained in:
@@ -7317,29 +7317,27 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
|
|
||||||
/* offer novices a chance to request helpful [sic] advice */
|
/* offer novices a chance to request helpful [sic] advice */
|
||||||
if (!skiphelp) {
|
if (!skiphelp) {
|
||||||
static const char *const helpintro[] = {
|
/* help text surrounding '?' choice should have exactly one NULL */
|
||||||
|
static const char *const helptext[] = {
|
||||||
"For a brief explanation of how this works, type '?' to select",
|
"For a brief explanation of how this works, type '?' to select",
|
||||||
"the next menu choice, then press <enter> or <return>.",
|
"the next menu choice, then press <enter> or <return>.",
|
||||||
NULL,
|
NULL, /* actual '?' menu entry gets inserted here */
|
||||||
}, *const helpepilog[] = {
|
|
||||||
"[To suppress this menu help, toggle off the 'cmdassist' option.]",
|
"[To suppress this menu help, toggle off the 'cmdassist' option.]",
|
||||||
"",
|
"",
|
||||||
NULL,
|
|
||||||
};
|
};
|
||||||
any = cg.zeroany;
|
any = cg.zeroany;
|
||||||
for (i = 0; helpintro[i]; ++i) {
|
for (i = 0; i < SIZE(helptext); ++i) {
|
||||||
Sprintf(buf, "%4s%.75s", "", helpintro[i]);
|
if (helptext[i]) {
|
||||||
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, FALSE,
|
Sprintf(buf, "%4s%.75s", "", helptext[i]);
|
||||||
buf, MENU_ITEMFLAGS_NONE);
|
any.a_int = 0;
|
||||||
}
|
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, FALSE,
|
||||||
any.a_int = '?' + 1; /* processing pick_list will subtract the 1 */
|
buf, MENU_ITEMFLAGS_NONE);
|
||||||
add_menu(tmpwin, &nul_glyphinfo, &any, '?', '?', ATR_NONE,
|
} else {
|
||||||
"view help for options menu", MENU_ITEMFLAGS_NONE);
|
any.a_int = '?' + 1; /* processing pick_list subtracts 1 */
|
||||||
any.a_int = 0;
|
add_menu(tmpwin, &nul_glyphinfo, &any, '?', '?', ATR_NONE,
|
||||||
for (i = 0; helpepilog[i]; ++i) {
|
"view help for options menu",
|
||||||
Sprintf(buf, "%4s%.75s", "", helpepilog[i]);
|
MENU_ITEMFLAGS_SKIPINVERT);
|
||||||
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, FALSE,
|
}
|
||||||
buf, MENU_ITEMFLAGS_NONE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user