]> git.lyx.org Git - features.git/commitdiff
Fix #7865 - Math autocorrection is broken
authorPavel Sanda <sanda@lyx.org>
Sun, 10 Feb 2013 05:51:30 +0000 (21:51 -0800)
committerPavel Sanda <sanda@lyx.org>
Sun, 10 Feb 2013 05:51:30 +0000 (21:51 -0800)
Patch from Martin Vermeer.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177004.html

src/Cursor.cpp
src/mathed/InsetMathNest.cpp

index 44698755b03e4cb89f3f044f70ec72949fcfd775..23db7bc74d9f37d1ad989dde7078ebf3d7a4be1e 100644 (file)
@@ -1525,8 +1525,6 @@ void Cursor::insert(MathData const & ar)
 
 bool Cursor::backspace()
 {
-       autocorrect() = false;
-
        if (selection()) {
                cap::eraseSelection(*this);
                return true;
@@ -1577,7 +1575,6 @@ bool Cursor::backspace()
 
 bool Cursor::erase()
 {
-       autocorrect() = false;
        if (inMacroMode())
                return true;
 
@@ -1632,7 +1629,6 @@ bool Cursor::up()
        if (disp_.dispatched())
                return true;
        setCursor(save);
-       autocorrect() = false;
        return false;
 }
 
@@ -1646,7 +1642,6 @@ bool Cursor::down()
        if (disp_.dispatched())
                return true;
        setCursor(save);
-       autocorrect() = false;
        return false;
 }
 
index 86920e1aafa947263e232dd2d7e0b0bc21feb8c3..0b24a1d74bc19bb5350f77e70e22bf8c2414f990 100644 (file)
@@ -706,6 +706,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        act == LFUN_UP_SELECT;
                cur.selHandle(select);
 
+               // handle autocorrect:
+               cur.autocorrect() = false;
+               cur.message(_("Autocorrect Off ('!' to enter)"));
+
                // go up/down
                bool up = act == LFUN_UP || act == LFUN_UP_SELECT;
                bool successful = cur.upDownInMath(up);