diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 60a003395a..13aa8d3382 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1569,6 +1569,8 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c) return true; } + selClearOrDel(cur); + MathMacro const * macro = cur.inset().asInsetMath()->asMacro(); if (macro && macro->displayMode() == MathMacro::DISPLAY_UNFOLDED) { // resume macro_mode @@ -1580,8 +1582,6 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c) return true; } - selClearOrDel(cur); - if (c == '\n') { if (currentMode() <= InsetMath::TEXT_MODE) cur.insert(c);