Is the attached ok ? Vincent (not so experienced with math yet)
Index: src/mathed/InsetMathNest.cpp =================================================================== --- src/mathed/InsetMathNest.cpp (revision 29669) +++ src/mathed/InsetMathNest.cpp (working copy) @@ -1519,7 +1519,13 @@ } // leave macro mode and try again if necessary - cur.macroModeClose(); + if (cur.macroModeClose()) { + MathAtom const atom = cur.prevAtom(); + if (atom->asNestInset() && atom->isActive()) { + cur.posBackward(); + cur.pushBackward(*cur.nextInset()); + } + } if (c == '{') cur.niceInsert(MathAtom(new InsetMathBrace)); else if (c != ' ')