From 961987024835e9b5178f9ac2b354dd1e1e999828 Mon Sep 17 00:00:00 2001 From: Isaac Oscar Gariano Date: Sat, 25 May 2019 11:17:41 +1200 Subject: [PATCH] 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 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 3078ef92de..67793e7e51 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; -- 2.39.5