X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathNest.cpp;h=0b24a1d74bc19bb5350f77e70e22bf8c2414f990;hb=efaae780dbbe3685e26e040ed4255e5abf268106;hp=affe7918c69b749479e38cf7e3af9b1a3862a974;hpb=65f26a7a1418d3a481949f49fd3f9868fe06e352;p=lyx.git diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index affe7918c6..0b24a1d74b 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -706,6 +706,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) act == LFUN_UP_SELECT; cur.selHandle(select); + // handle autocorrect: + cur.autocorrect() = false; + cur.message(_("Autocorrect Off ('!' to enter)")); + // go up/down bool up = act == LFUN_UP || act == LFUN_UP_SELECT; bool successful = cur.upDownInMath(up); @@ -806,7 +810,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) if (cur.pos() == 0) // May affect external cell: cur.recordUndoInset(); - else + else if (!cur.inMacroMode()) cur.recordUndoSelection(); // if the inset can not be removed from within, delete it if (!cur.backspace()) { @@ -872,7 +876,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) // if relevant. Think typing "\frac". if (cmd.argument()[0] == ' ' && cur.inMacroMode() && cur.macroName() != "\\" - && cur.macroModeClose()) { + && cur.macroModeClose() && cur.pos() > 0) { MathAtom const atom = cur.prevAtom(); if (atom->asNestInset() && atom->isActive()) { cur.posBackward(); @@ -1368,7 +1372,6 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, // we just need to be in math mode to enable that case LFUN_MATH_SIZE: case LFUN_MATH_SPACE: - case LFUN_MATH_LIMITS: case LFUN_MATH_EXTERN: flag.setEnabled(true); break; @@ -1442,6 +1445,10 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, flag.setEnabled(false); break; + case LFUN_CAPTION_INSERT: + flag.setEnabled(false); + break; + case LFUN_SPACE_INSERT: { docstring const & name = cmd.argument(); if (name == "visible") @@ -1706,6 +1713,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c) //lyxerr << "starting with macro" << endl; bool reduced = cap::reduceSelectionToOneCell(cur); if (reduced || !cur.selection()) { + cur.recordUndoInset(); docstring const safe = cap::grabAndEraseSelection(cur); if (!cur.inRegexped()) cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false))); @@ -2064,7 +2072,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur) } sort(locals.begin(), locals.end()); - if (globals.size() > 0) + if (!globals.empty()) return; // fill in global macros @@ -2099,6 +2107,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur) globals.push_back(from_ascii("\\root")); globals.push_back(from_ascii("\\tabular")); globals.push_back(from_ascii("\\stackrel")); + globals.push_back(from_ascii("\\stackrelthree")); globals.push_back(from_ascii("\\binom")); globals.push_back(from_ascii("\\choose")); globals.push_back(from_ascii("\\brace"));