From: Vincent van Ravesteijn Date: Fri, 15 May 2009 22:00:43 +0000 (+0000) Subject: Fix bug #2034: Inconsistent behavior of cursor inside mathed. X-Git-Tag: 2.0.0~6558 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7fc21bf7661e933ff0b47b7d2d0c96fe371c05f4;p=features.git Fix bug #2034: Inconsistent behavior of cursor inside mathed. When closing the macromode, do the same trick as in lines 835--838. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29686 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 12a0e2bcbf..8fef03f2f1 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1525,7 +1525,13 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c) } // 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 != ' ')