if (cit->second.lyxtype() == type) {
if (!cit->second.obsoleted_by().empty())
continue;
- docstring label = cit->first;
+ docstring name = cit->first;
// we remove the "Flex:" prefix, if it is present
- if (prefixIs(label, from_ascii("Flex:")))
- label = label.substr(5);
+ if (prefixIs(name, from_ascii("Flex:")))
+ name = name.substr(5);
+ docstring const label = (cit->second.menustring().empty()) ?
+ name
+ : cit->second.menustring();
addWithStatusCheck(MenuItem(MenuItem::Command,
toqstr(translateIfPossible(label)),
- FuncRequest(LFUN_FLEX_INSERT, Lexer::quoteString(label))));
+ FuncRequest(LFUN_FLEX_INSERT, Lexer::quoteString(name))));
}
}
// FIXME This is a little clunky.
}
InsetInfo const * iinset = static_cast<InsetInfo const *>(inset);
- string const type = iinset->infoType();
- vector<pair<string,docstring>> const args = iinset->getArguments(type);
+ string const type = iinset->params().infoType();
+ vector<pair<string,docstring>> const args =
+ iinset->params().getArguments(&bv->buffer(), type);
// Don't generate a menu for big lists (such as lfuns and rcs)
if (args.size() > 15)
bool Menus::searchMenu(FuncRequest const & func,
- docstring_list & names) const
+ docstring_list & names, BufferView const * bv) const
{
MenuDefinition menu;
- d->expand(d->menubar_, menu, 0);
+ d->expand(d->menubar_, menu, bv);
return menu.searchMenu(func, names);
}