#include <config.h>
+//#define AUTOCORRECT
+
#include "InsetMathNest.h"
#include "InsetMathArray.h"
#include "InsetMathSpace.h"
#include "InsetMathSymbol.h"
#include "InsetMathUnknown.h"
+#ifdef AUTOCORRECT
+#include "MathAutoCorrect.h"
+#endif
#include "MathCompletionList.h"
#include "MathData.h"
#include "MathFactory.h"
// 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
}
+#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);