mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Avoid duplicating mode changing commands
This commit is contained in:
parent
324651899e
commit
5cdbaf51ee
@ -1450,13 +1450,15 @@ bool Cursor::macroModeClose()
|
|||||||
atom.nucleus()->cell(0).append(selection);
|
atom.nucleus()->cell(0).append(selection);
|
||||||
|
|
||||||
if (in->currentMode() == Inset::TEXT_MODE
|
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()));
|
MathAtom at(new InsetMathEnsureMath(buffer()));
|
||||||
at.nucleus()->cell(0).push_back(atom);
|
at.nucleus()->cell(0).push_back(atom);
|
||||||
niceInsert(at);
|
niceInsert(at);
|
||||||
posForward();
|
posForward();
|
||||||
} else if (in->currentMode() == Inset::MATH_MODE
|
} 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());
|
MathAtom at = createInsetMath("text", 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