Fix bug 3407: Undo with text-in-mathmode

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
This commit is contained in:
Jean-Marc Lasgouttes 2008-08-15 15:50:42 +00:00
parent 416df64b5b
commit 97e6476feb

View 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 {