mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fix, but keep disabled, mathed autocorrect
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27927 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
96b062a520
commit
d6f30aac95
@ -10,6 +10,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
//#define AUTOCORRECT
|
||||
|
||||
#include "InsetMathNest.h"
|
||||
|
||||
#include "InsetMathArray.h"
|
||||
@ -25,6 +27,9 @@
|
||||
#include "InsetMathSpace.h"
|
||||
#include "InsetMathSymbol.h"
|
||||
#include "InsetMathUnknown.h"
|
||||
#ifdef AUTOCORRECT
|
||||
#include "MathAutoCorrect.h"
|
||||
#endif
|
||||
#include "MathCompletionList.h"
|
||||
#include "MathData.h"
|
||||
#include "MathFactory.h"
|
||||
@ -1513,10 +1518,10 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
|
||||
// This is annoying as one has to press <space> far too often.
|
||||
// Disable it.
|
||||
|
||||
#if 0
|
||||
#ifdef AUTOCORRECT
|
||||
// leave autocorrect mode if necessary
|
||||
if (autocorrect() && c == ' ') {
|
||||
autocorrect() = false;
|
||||
if (cur.autocorrect() && c == ' ') {
|
||||
cur.autocorrect() = false;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@ -1616,9 +1621,11 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
|
||||
}
|
||||
|
||||
|
||||
#ifdef AUTOCORRECT
|
||||
// try auto-correction
|
||||
//if (autocorrect() && hasPrevAtom() && math_autocorrect(prevAtom(), c))
|
||||
// return true;
|
||||
if (cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
// no special circumstances, so insert the character without any fuss
|
||||
cur.insert(c);
|
||||
|
Loading…
Reference in New Issue
Block a user