mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Ensure consistency
On export, a macro defined in ERT (or not defined at all) is left in the same environment it is entered. So, don't explicitly insert it in an ensuremath environment when it is entered in a textmode one.
This commit is contained in:
parent
615c733844
commit
a24033ff0e
@ -1449,9 +1449,11 @@ bool Cursor::macroModeClose()
|
|||||||
else if (atom.nucleus()->nargs() > 0)
|
else if (atom.nucleus()->nargs() > 0)
|
||||||
atom.nucleus()->cell(0).append(selection);
|
atom.nucleus()->cell(0).append(selection);
|
||||||
|
|
||||||
|
bool ert_macro = atomAsMacro && !atomAsMacro->macro();
|
||||||
|
|
||||||
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
|
||||||
&& name != from_ascii("ensuremath")) {
|
&& name != from_ascii("ensuremath") && !ert_macro) {
|
||||||
MathAtom at(new InsetMathEnsureMath(buffer()));
|
MathAtom at(new InsetMathEnsureMath(buffer()));
|
||||||
at.nucleus()->cell(0).push_back(atom);
|
at.nucleus()->cell(0).push_back(atom);
|
||||||
niceInsert(at);
|
niceInsert(at);
|
||||||
|
Loading…
Reference in New Issue
Block a user