From: Pavel Sanda Date: Sun, 10 Feb 2013 05:51:30 +0000 (-0800) Subject: Fix #7865 - Math autocorrection is broken X-Git-Tag: 2.1.0beta1~752 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5000a016cf1d49add3a3cee4e95dbc3c65197bf4;p=features.git Fix #7865 - Math autocorrection is broken Patch from Martin Vermeer. http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177004.html --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 44698755b0..23db7bc74d 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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; } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 86920e1aaf..0b24a1d74b 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -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);