mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +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)
|
||||
atom.nucleus()->cell(0).append(selection);
|
||||
|
||||
bool ert_macro = atomAsMacro && !atomAsMacro->macro();
|
||||
|
||||
if (in && in->currentMode() == Inset::TEXT_MODE
|
||||
&& atom.nucleus()->currentMode() == Inset::MATH_MODE
|
||||
&& name != from_ascii("ensuremath")) {
|
||||
&& name != from_ascii("ensuremath") && !ert_macro) {
|
||||
MathAtom at(new InsetMathEnsureMath(buffer()));
|
||||
at.nucleus()->cell(0).push_back(atom);
|
||||
niceInsert(at);
|
||||
|
Loading…
Reference in New Issue
Block a user