case LFUN_ERT_INSERT:
case LFUN_LISTING_INSERT:
case LFUN_MARGINALNOTE_INSERT:
- case LFUN_OPTIONAL_INSERT:
+ case LFUN_ARGUMENT_INSERT:
case LFUN_INDEX_INSERT:
case LFUN_PREVIEW_INSERT:
// Open the inset, and move the current selection
if (cit == floats.end() ||
// and that we know how to generate a list of them
(!cit->second.needsFloatPkg() && cit->second.listCommand().empty())) {
- flag.unknown(true);
+ flag.setUnknown(true);
// probably not necessary, but...
enable = false;
}
case LFUN_INFO_INSERT:
code = INFO_CODE;
break;
- case LFUN_OPTIONAL_INSERT:
- code = OPTARG_CODE;
- enable = cur.paragraph().insetList().count(OPTARG_CODE)
- < cur.paragraph().layout().optionalargs;
+ case LFUN_ARGUMENT_INSERT: {
+ code = ARG_CODE;
+ Layout const & lay = cur.paragraph().layout();
+ int const numargs = lay.reqargs + lay.optargs;
+ enable = cur.paragraph().insetList().count(ARG_CODE) < numargs;
break;
+ }
case LFUN_INDEX_INSERT:
code = INDEX_CODE;
break;