From: Jean-Marc Lasgouttes Date: Fri, 15 Aug 2008 15:50:42 +0000 (+0000) Subject: Fix bug 3407: Undo with text-in-mathmode X-Git-Tag: 1.6.10~3637 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=97e6476feb2312ca7d46d565df5a2add1914e464;p=features.git 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 --- diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 867d4f466f..c9fdc1abc6 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -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 {