]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Fix a copy-paste error introduced in b754fb02
[lyx.git] / src / Cursor.cpp
index 7a13e1c3c9a5229997f8e8295c533d5dd540a32f..be042940a081b3806ca129c6f0d657f8f081b99e 100644 (file)
@@ -1599,8 +1599,11 @@ bool Cursor::macroModeClose()
 
        docstring const name = s.substr(1);
        InsetMathNest * const in = inset().asInsetMath()->asNestInset();
-       if (in && in->interpretString(*this, s))
+       if (in && in->interpretString(*this, s)) {
+               // end undo group that was opened before in was created
+               endUndoGroup();
                return true;
+       }
        MathAtom atom = buffer()->getMacro(name, *this, false) ?
                MathAtom(new MathMacro(buffer(), name)) : createInsetMath(name, buffer());
 
@@ -1633,7 +1636,9 @@ bool Cursor::macroModeClose()
                else
                        insert(selection);
        }
-       
+
+       // end undo group that was opened before in was created
+       endUndoGroup();
        return true;
 }