Fix #7865 - Math autocorrection is broken

Patch from Martin Vermeer.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177004.html
This commit is contained in:
Pavel Sanda 2013-02-09 21:51:30 -08:00
parent d963eef9f0
commit 5000a016cf
2 changed files with 4 additions and 5 deletions

View 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;
}

View 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);