* Avoid undo step when using backspace in macro mode
* Use recordUndoInset when entering macro mode (if one enters something like \hline, the outer inset itself will be modified)
* Use recordUndoInset when pasting in an INsetMathGrid (same reason as above)
hline_enabled = status.enabled();
if (grid.nargs() == 1) {
// single cell/part of cell
- cur.recordUndo();
+ cur.recordUndoInset();
cur.cell().insert(cur.pos(), grid.cell(0));
cur.pos() += grid.cell(0).size();
if (hline_enabled)
if (cur.pos() == 0)
// May affect external cell:
cur.recordUndoInset();
- else
+ else if (!cur.inMacroMode())
cur.recordUndoSelection();
// if the inset can not be removed from within, delete it
if (!cur.backspace()) {
//lyxerr << "starting with macro" << endl;
bool reduced = cap::reduceSelectionToOneCell(cur);
if (reduced || !cur.selection()) {
+ cur.recordUndoInset();
docstring const safe = cap::grabAndEraseSelection(cur);
if (!cur.inRegexped())
cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false)));