X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathNest.cpp;h=00d4e2ac6e0c7759f4e48fd7cd99221dc907f65d;hb=36dbec45069bf3d9db923200835e44f44d904eb8;hp=0844b4d8a9ad8c3bc6c9794925c651653fbc64b5;hpb=95146d3cf911230ee6c810e22d0243f83ce977a3;p=features.git diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 0844b4d8a9..00d4e2ac6e 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -994,12 +994,13 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) bool fold = cmd.action == LFUN_MATH_MACRO_FOLD; bool found = findMacroToFoldUnfold(it, fold); if (found) { - cur.recordUndo(); + MathMacro * macro = it.nextInset()->asInsetMath()->asMacro(); + cur.recordUndoInset(); if (fold) - it.nextInset()->asInsetMath()->asMacro()->fold(cur); + macro->fold(cur); else - it.nextInset()->asInsetMath()->asMacro()->unfold(cur); - } + macro->unfold(cur); + } break; }