]> git.lyx.org Git - features.git/commitdiff
Fix previous commit for macros with arguments, again.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 7 Jul 2009 08:23:31 +0000 (08:23 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 7 Jul 2009 08:23:31 +0000 (08:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30398 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathNest.cpp

index c66a3857f98a3fc36d1d61e2d6fc24bc7cb24cc2..413d32efded532f7ffaf1eb5640e69d89ebad53f 100644 (file)
@@ -1862,7 +1862,8 @@ bool InsetMathNest::cursorMathForward(Cursor & cur)
        if (cur.pos() != cur.lastpos() && cur.openable(cur.nextAtom())) {
                cur.pushBackward(*cur.nextAtom().nucleus());
                cur.inset().idxFirst(cur);
-               if (cur.inset().asInsetMath()->asMacro())
+               MathMacro const * macro = cur.inset().asInsetMath()->asMacro();
+               if (macro && macro->displayMode() == MathMacro::DISPLAY_UNFOLDED)
                        // editing macros is only possible at lastpos
                        cur.pos() = cur.lastpos();
                return true;
@@ -1888,9 +1889,11 @@ bool InsetMathNest::cursorMathBackward(Cursor & cur)
        }
        MathMacro const * macro = cur.inset().asInsetMath()->asMacro();
        int s = cur.depth() - 2;
-       if (macro && s >= 0 && cur[s].inset().asInsetMath())
+       if (macro && macro->displayMode() == MathMacro::DISPLAY_UNFOLDED
+                 && s >= 0 && cur[s].inset().asInsetMath())
                // editing macros is only possible at lastpos
                return cur.popBackward();
+
        if (cur.posBackward() || idxBackward(cur))
                return true;
        // try to pop backwards --- but don't pop out of math! leave that to