+ } else if (macro && brace && !needs_mathmode && !textmode_macro) {
+ // This is a user defined macro, not a InsetMathMacro, so we
+ // cannot be sure what mode is needed. We leave it in the
+ // same environment it was entered by closing either \lyxmathsym
+ // or \ensuremath, whichever was opened.
+ os << '}';