docstring const name = s.substr(1);
InsetMathNest * const in = inset().asInsetMath()->asNestInset();
- if (in && in->interpretString(*this, s)) {
- // end undo group that was opened before in was created
- endUndoGroup();
+ if (in && in->interpretString(*this, s))
return true;
- }
MathAtom atom = buffer()->getMacro(name, *this, false) ?
MathAtom(new MathMacro(buffer(), name)) : createInsetMath(name, buffer());
else
insert(selection);
}
-
- // end undo group that was opened before in was created
- endUndoGroup();
+
return true;
}
case LFUN_SELF_INSERT:
if (cmd.argument().size() != 1) {
- // use a group because interpretString() might
- // record an extra undo step
- cur.beginUndoGroup();
cur.recordUndoSelection();
docstring const arg = cmd.argument();
if (!interpretString(cur, arg))
cur.insert(arg);
- cur.endUndoGroup();
break;
}
// Don't record undo steps if we are in macro mode and thus
cur.cell().erase(cur.pos());
cur.plainInsert(MathAtom(
new InsetMathBig(name.substr(1), delim)));
- // end undo group that was opened before p was created
- cur.endUndoGroup();
return true;
}
}
bool reduced = cap::reduceSelectionToOneCell(cur);
if (reduced || !cur.selection()) {
docstring const safe = cap::grabAndEraseSelection(cur);
- if (!cur.inRegexped()) {
- // open a group because interpretString() might
- // record an extra undo step when finalizing
- cur.beginUndoGroup();
+ if (!cur.inRegexped())
cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false)));
- } else
+ else
cur.niceInsert(createInsetMath("backslash", buf));
}
return true;