Fix bug #1435. Now Ctrl-m enters math mode when in text-in-math mode,

instead of producing nested text boxes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29746 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-05-20 14:52:03 +00:00
parent 86e73ee668
commit 1a65f586ee

View File

@ -20,6 +20,7 @@
#include "InsetMathColor.h"
#include "InsetMathComment.h"
#include "InsetMathDelim.h"
#include "InsetMathEnsureMath.h"
#include "InsetMathHull.h"
#include "InsetMathRef.h"
#include "InsetMathScript.h"
@ -954,7 +955,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
docstring const save_selection = grabAndEraseSelection(cur);
selClearOrDel(cur);
//cur.plainInsert(MathAtom(new InsetMathMBox(cur.bv())));
cur.plainInsert(MathAtom(new InsetMathBox(from_ascii("mbox"))));
if (currentMode() == Inset::TEXT_MODE)
cur.plainInsert(MathAtom(new InsetMathEnsureMath));
else
cur.plainInsert(MathAtom(new InsetMathBox(from_ascii("mbox"))));
cur.posBackward();
cur.pushBackward(*cur.nextInset());
cur.niceInsert(save_selection);