From: Enrico Forestieri Date: Fri, 16 Sep 2016 00:15:52 +0000 (+0200) Subject: Correctly distinguish ERT macros from predefined ones such as \alpha X-Git-Tag: 2.3.0alpha1~1015 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c4aca5705b149511d9311aba8cbb94254a801756;p=features.git Correctly distinguish ERT macros from predefined ones such as \alpha --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 6485fc4a56..72c723b502 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1426,9 +1426,9 @@ bool Cursor::macroModeClose() InsetMathNest * const in = inset().asInsetMath()->asNestInset(); if (in && in->interpretString(*this, s)) return true; - bool const ert_macro = !buffer()->getMacro(name, *this, false); - MathAtom atom = ert_macro ? createInsetMath(name, buffer()) - : MathAtom(new MathMacro(buffer(), name)); + bool const user_macro = buffer()->getMacro(name, *this, false); + MathAtom atom = user_macro ? MathAtom(new MathMacro(buffer(), name)) + : createInsetMath(name, buffer()); // try to put argument into macro, if we just inserted a macro bool macroArg = false; @@ -1455,6 +1455,7 @@ bool Cursor::macroModeClose() bool keep_mathmode = it != words.end() && (it->second.inset == "font" || it->second.inset == "oldfont" || it->second.inset == "mbox"); + bool ert_macro = !user_macro && it == words.end(); if (in && in->currentMode() == Inset::TEXT_MODE && atom.nucleus()->currentMode() == Inset::MATH_MODE