- BufferParams const & bp = cur.buffer().params();
- LayoutPtr const layout =
- bp.getTextClass().emptyLayout();
- //lyxerr << "\nInsetERT::doDispatch (begin): cmd: " << cmd << endl;
- switch (cmd.action) {
-
- case LFUN_MOUSE_PRESS:
- if (cmd.button() != mouse_button::button3)
- InsetCollapsable::doDispatch(cur, cmd);
- else
- // This makes the cursor leave the
- // inset when it collapses on mouse-3
- cur.undispatched();
- break;
-
- case LFUN_QUOTE_INSERT: {
- // We need to bypass the fancy quotes in Text
- FuncRequest f(LFUN_SELF_INSERT, "\"");
- dispatch(cur, f);
- break;
- }
- case LFUN_INSET_MODIFY: {
- InsetCollapsable::CollapseStatus st;
- InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
- setStatus(cur, st);
- break;
- }
+ switch (cmd.action()) {
+ case LFUN_INSET_MODIFY:
+ if (cmd.getArg(0) == "ert") {
+ cur.recordUndoInset(ATOMIC_UNDO, this);
+ setStatus(cur, string2params(to_utf8(cmd.argument())));
+ break;
+ }
+ //fall-through