mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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"!
This commit is contained in:
parent
dd4ca3ad4c
commit
4c587fb9da
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user