X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=config%2Fmenu.c;h=7634d567e77949d2f7a71d05a5de8d9e96403500;hp=47bec3434fef16f1b0c46e0f8d908ee704aa57ca;hb=8feb6085df8ac5f420533fba818aad40d0ff0e09;hpb=2f1132cbcec40e431991cda7ff3744455b46c3df diff --git a/config/menu.c b/config/menu.c index 47bec34..7634d56 100644 --- a/config/menu.c +++ b/config/menu.c @@ -549,6 +549,15 @@ void menu_finalize(struct menu *parent) sym->flags |= SYMBOL_WARNED; } + /* + * For non-optional choices, add a reverse dependency (corresponding to + * a select) of ' && m'. This prevents the user from + * setting the choice mode to 'n' when the choice is visible. + * + * This would also work for non-choice symbols, but only non-optional + * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented + * as a type of symbol. + */ if (sym && !sym_is_optional(sym) && parent->prompt) { sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, expr_alloc_and(parent->prompt->visible.expr,