mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Correctly distinguish ERT macros from predefined ones such as \alpha
This commit is contained in:
parent
a26e75cd8a
commit
c4aca5705b
@ -1426,9 +1426,9 @@ bool Cursor::macroModeClose()
|
|||||||
InsetMathNest * const in = inset().asInsetMath()->asNestInset();
|
InsetMathNest * const in = inset().asInsetMath()->asNestInset();
|
||||||
if (in && in->interpretString(*this, s))
|
if (in && in->interpretString(*this, s))
|
||||||
return true;
|
return true;
|
||||||
bool const ert_macro = !buffer()->getMacro(name, *this, false);
|
bool const user_macro = buffer()->getMacro(name, *this, false);
|
||||||
MathAtom atom = ert_macro ? createInsetMath(name, buffer())
|
MathAtom atom = user_macro ? MathAtom(new MathMacro(buffer(), name))
|
||||||
: MathAtom(new MathMacro(buffer(), name));
|
: createInsetMath(name, buffer());
|
||||||
|
|
||||||
// try to put argument into macro, if we just inserted a macro
|
// try to put argument into macro, if we just inserted a macro
|
||||||
bool macroArg = false;
|
bool macroArg = false;
|
||||||
@ -1455,6 +1455,7 @@ bool Cursor::macroModeClose()
|
|||||||
bool keep_mathmode = it != words.end() && (it->second.inset == "font"
|
bool keep_mathmode = it != words.end() && (it->second.inset == "font"
|
||||||
|| it->second.inset == "oldfont"
|
|| it->second.inset == "oldfont"
|
||||||
|| it->second.inset == "mbox");
|
|| it->second.inset == "mbox");
|
||||||
|
bool ert_macro = !user_macro && it == words.end();
|
||||||
|
|
||||||
if (in && in->currentMode() == Inset::TEXT_MODE
|
if (in && in->currentMode() == Inset::TEXT_MODE
|
||||||
&& atom.nucleus()->currentMode() == Inset::MATH_MODE
|
&& atom.nucleus()->currentMode() == Inset::MATH_MODE
|
||||||
|
Loading…
Reference in New Issue
Block a user