From: Enrico Forestieri Date: Sat, 10 Sep 2016 00:39:57 +0000 (+0200) Subject: Avoid duplicating mode changing commands X-Git-Tag: 2.3.0alpha1~1050 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5cdbaf51;p=lyx.git Avoid duplicating mode changing commands --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 6f1a1949d1..4e63734155 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1450,13 +1450,15 @@ bool Cursor::macroModeClose() atom.nucleus()->cell(0).append(selection); if (in->currentMode() == Inset::TEXT_MODE - && atom.nucleus()->currentMode() == Inset::MATH_MODE) { + && atom.nucleus()->currentMode() == Inset::MATH_MODE + && name != from_ascii("ensuremath")) { MathAtom at(new InsetMathEnsureMath(buffer())); at.nucleus()->cell(0).push_back(atom); niceInsert(at); posForward(); } else if (in->currentMode() == Inset::MATH_MODE - && atom.nucleus()->currentMode() == Inset::TEXT_MODE) { + && atom.nucleus()->currentMode() == Inset::TEXT_MODE + && name != from_ascii("text")) { MathAtom at = createInsetMath("text", buffer()); at.nucleus()->cell(0).push_back(atom); niceInsert(at);