]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
minimal effort implementation of:
[lyx.git] / src / cursor.C
index 45ba966efdbb36772317905909488a4db3993830..a0603328452a98586598dff1ac35714762b88263 100644 (file)
@@ -35,7 +35,6 @@
 #include "insets/insettabular.h"
 #include "insets/insettext.h"
 
-#include "mathed/math_biginset.h"
 #include "mathed/math_data.h"
 #include "mathed/math_inset.h"
 #include "mathed/math_scriptinset.h"
@@ -64,7 +63,6 @@ using std::endl;
 using std::isalpha;
 #endif
 using std::min;
-using std::swap;
 
 namespace {
 
@@ -652,22 +650,6 @@ void LCursor::markErase()
 
 void LCursor::plainInsert(MathAtom const & t)
 {
-       // Create a MathBigInset from cell()[pos() - 1] and t if possible
-       if (!empty() && pos() > 0 && cell()[pos() - 1]->asUnknownInset()) {
-               string const name = asString(t);
-               if (MathBigInset::isBigInsetDelim(name)) {
-                       string prev = asString(cell()[pos() - 1]);
-                       if (prev[0] == '\\') {
-                               prev = prev.substr(1);
-                               latexkeys const * l = in_word_set(prev);
-                               if (l && l->inset == "big") {
-                                       cell()[pos() - 1] =
-                                               MathAtom(new MathBigInset(prev, name));
-                                       return;
-                               }
-                       }
-               }
-       }
        cell().insert(pos(), t);
        ++pos();
 }
@@ -877,6 +859,9 @@ bool LCursor::macroModeClose()
        if (macro && macro->getInsetName() == name)
                lyxerr << "can't enter recursive macro" << endl;
 
+       MathNestInset * const in = inset().asMathInset()->asNestInset();
+       if (in && in->interpret(*this, s))
+               return true;
        plainInsert(createMathInset(name));
        return true;
 }