commit 4c587fb9dab64e987e5dc583630001a911f4a13c
Author: Isaac Oscar Gariano <[email protected]>
Date: Sat May 25 11:17:41 2019 +1200
Make autocorrect have priority.
Place autocorrect at the top of `InsetMathNest::interpretChar`,
ensuring that any autocorrections that trigger on special characters
(such as '^' or '~') work. In particular, you can now make an
autocorrection from "<~" to "\preceq"!
---
src/mathed/InsetMathNest.cpp | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 3078ef9..67793e7 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -1607,6 +1607,11 @@ void InsetMathNest::lfunMouseRelease(Cursor & cur,
FuncRequest & cmd)
bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
{
+ // try auto-correction
+ if (lyxrc.autocorrection_math && cur.pos() != 0
+ && math_autocorrect(cur, c))
+ return true;
+
//lyxerr << "interpret 2: '" << c << "'" << endl;
docstring save_selection;
if (c == '^' || c == '_')
@@ -1847,12 +1852,6 @@ bool InsetMathNest::interpretChar(Cursor & cur,
char_type const c)
return true;
}
-
- // try auto-correction
- if (lyxrc.autocorrection_math && cur.pos() != 0
- && math_autocorrect(cur, c))
- return true;
-
// no special circumstances, so insert the character without any fuss
cur.insert(c);
return true;