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/branches/BRANCH_1_5_X@26187 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-08-16 07:44:22 +00:00
parent ab72650397
commit 7a7472a8fd
2 changed files with 3 additions and 0 deletions

View File

@ -917,6 +917,7 @@ goto_char_backwards:
// ignore math-mode on when already in math mode
if (currentMode() == Inset::MATH_MODE && cmd.argument() == "on")
break;
recordUndoSelection(cur);
cur.macroModeClose();
docstring const save_selection = grabAndEraseSelection(cur);
selClearOrDel(cur);
@ -927,6 +928,7 @@ goto_char_backwards:
cur.niceInsert(save_selection);
#else
if (currentMode() == Inset::TEXT_MODE) {
recordUndoSelection(cur);
cur.niceInsert(MathAtom(new InsetMathHull("simple")));
cur.message(_("create new math text environment ($...$)"));
} else {

View File

@ -62,6 +62,7 @@ What's new
- Empty lines are correctly removed when the cursor moves due to the
"cursor follows scrollbar" feature (bug 5065).
- Fix undo for "text in math mode" (bug 3407).
* DOCUMENTATION AND LOCALIZATION