- string res = dispatch(action, argument);
-
- commandshortcut.erase();
-
- if (show_sc && action != LFUN_SELFINSERT) {
- // Put name of command and list of shortcuts
- // for it in minibuffer
- string comname = lyxaction.getActionName(action);
-
- int pseudoaction = action;
- bool argsadded = false;
-
- if (!argument.empty()) {
- // the pseudoaction is useful for the bindings
- pseudoaction =
- lyxaction.searchActionArg(action,
- argument);
-
- if (pseudoaction == LFUN_UNKNOWN_ACTION) {
- pseudoaction = action;
- } else {
- comname += " " + argument;
- argsadded = true;
- }
- }
-
- string const shortcuts =
- toplevel_keymap->findbinding(pseudoaction);
-
- if (!shortcuts.empty()) {
- comname += ": " + shortcuts;
- } else if (!argsadded && !argument.empty()) {
- comname += " " + argument;
- }
-
- if (!comname.empty()) {
- comname = strip(comname);
- commandshortcut = "(" + comname + ')';
- }
- }
-
- if (res.empty()) {
- if (!commandshortcut.empty()) {
- owner->getMiniBuffer()->addSet(commandshortcut);
- }
- } else {
- owner->getMiniBuffer()->addSet(' ' + commandshortcut);
- }