#include "InsetMathColor.h"
#include "InsetMathComment.h"
#include "InsetMathDelim.h"
+#include "InsetMathEnsureMath.h"
#include "InsetMathHull.h"
#include "InsetMathRef.h"
#include "InsetMathScript.h"
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);
case LFUN_FONT_DEFAULT:
flag.setEnabled(true);
break;
- case LFUN_MATH_MUTATE:
- //flag.setOnOff(mathcursor::formula()->hullType() == to_utf8(cmd.argument()));
- flag.setOnOff(false);
- break;
// we just need to be in math mode to enable that
case LFUN_MATH_SIZE: