]> git.lyx.org Git - features.git/commitdiff
Fix bug #2034: Inconsistent behavior of cursor inside mathed.
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 15 May 2009 22:00:43 +0000 (22:00 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 15 May 2009 22:00:43 +0000 (22:00 +0000)
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

src/mathed/InsetMathNest.cpp

index 12a0e2bcbf6d38cefa0ab2d0e75345fcddd95dcd..8fef03f2f1da901a19231ab509550901a6c8890e 100644 (file)
@@ -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 != ' ')