]> git.lyx.org Git - features.git/commitdiff
Fix crash when selecting part of a macro and trying to resume macro-mode editing.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 7 Jul 2009 08:13:07 +0000 (08:13 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 7 Jul 2009 08:13:07 +0000 (08:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30395 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathNest.cpp

index 60a003395a21cbdc4970d7902b0e4e1019f4925c..13aa8d3382426c0232dbae13cd30be5c9c3e40b9 100644 (file)
@@ -1569,6 +1569,8 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
                return true;
        }
 
+       selClearOrDel(cur);
+
        MathMacro const * macro = cur.inset().asInsetMath()->asMacro();
        if (macro && macro->displayMode() == MathMacro::DISPLAY_UNFOLDED) {
                // resume macro_mode
@@ -1580,8 +1582,6 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
                return true;    
        }
 
-       selClearOrDel(cur);
-
        if (c == '\n') {
                if (currentMode() <= InsetMath::TEXT_MODE)
                        cur.insert(c);