]> git.lyx.org Git - features.git/commitdiff
Fix bug 3407: Undo with text-in-mathmode
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Aug 2008 15:50:42 +0000 (15:50 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Aug 2008 15:50:42 +0000 (15:50 +0000)
http://bugzilla.lyx.org/show_bug.cgi?id=3407

* InsetMathNest.cpp (doDispatch/LFUN_MATH_MODE): handle undo

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26173 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathNest.cpp

index 867d4f466f7561d21285b147f5f71056c15d6a4f..c9fdc1abc6e9e7574bcf329c969b4a91d9dc587b 100644 (file)
@@ -929,6 +929,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                // ignore math-mode on when already in math mode
                if (currentMode() == Inset::MATH_MODE && cmd.argument() == "on")
                        break;
+               cur.recordUndoSelection();
                cur.macroModeClose();
                docstring const save_selection = grabAndEraseSelection(cur);
                selClearOrDel(cur);
@@ -939,6 +940,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.niceInsert(save_selection);
 #else
                if (currentMode() == Inset::TEXT_MODE) {
+                       cur.recordUndoSelection();
                        cur.niceInsert(MathAtom(new InsetMathHull("simple")));
                        cur.message(_("create new math text environment ($...$)"));
                } else {