fix a strange bug with option menu
It was impossible to select entry 62 in the allopt[] array from the 'm O' menu, apparently because of a collision with the ascii value of a question mark. Entry 62 was currently the guicolor option.
This commit is contained in:
@@ -8718,6 +8718,8 @@ term_for_boolean(int idx, boolean *b)
|
|||||||
return boolean_term;
|
return boolean_term;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define HELP_IDX (SIZE(allopt))
|
||||||
|
|
||||||
/* the #optionsfull command */
|
/* the #optionsfull command */
|
||||||
int
|
int
|
||||||
doset(void) /* changing options via menu by Per Liboriussen */
|
doset(void) /* changing options via menu by Per Liboriussen */
|
||||||
@@ -8766,7 +8768,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
Sprintf(buf, "%4s%.75s", "", helptext[i]);
|
Sprintf(buf, "%4s%.75s", "", helptext[i]);
|
||||||
add_menu_str(tmpwin, buf);
|
add_menu_str(tmpwin, buf);
|
||||||
} else {
|
} else {
|
||||||
any.a_int = '?' + 1; /* processing pick_list subtracts 1 */
|
any.a_int = HELP_IDX + 1; /* processing pick_list subtracts 1 */
|
||||||
add_menu(tmpwin, &nul_glyphinfo, &any, '?', '?', ATR_NONE,
|
add_menu(tmpwin, &nul_glyphinfo, &any, '?', '?', ATR_NONE,
|
||||||
clr, "view help for options menu",
|
clr, "view help for options menu",
|
||||||
MENU_ITEMFLAGS_SKIPINVERT);
|
MENU_ITEMFLAGS_SKIPINVERT);
|
||||||
@@ -8877,7 +8879,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
*/
|
*/
|
||||||
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) {
|
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) {
|
||||||
opt_indx = pick_list[pick_idx].item.a_int - 1;
|
opt_indx = pick_list[pick_idx].item.a_int - 1;
|
||||||
if (opt_indx == '?') {
|
if (opt_indx == HELP_IDX) {
|
||||||
display_file(OPTMENUHELP, FALSE);
|
display_file(OPTMENUHELP, FALSE);
|
||||||
gavehelp = TRUE;
|
gavehelp = TRUE;
|
||||||
continue; /* just handled '?'; there might be more picks */
|
continue; /* just handled '?'; there might be more picks */
|
||||||
@@ -8947,6 +8949,8 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
return ECMD_OK;
|
return ECMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef HELP_IDX
|
||||||
|
|
||||||
/* doset(#optionsfull command) menu entries for compound options */
|
/* doset(#optionsfull command) menu entries for compound options */
|
||||||
static void
|
static void
|
||||||
doset_add_menu(
|
doset_add_menu(
|
||||||
|
|||||||
Reference in New Issue
Block a user