]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.C
whichFont down to 5.3%
[lyx.git] / src / mathed / math_cursor.C
index 64fbade29c2e29a4582de29254cd677ff9103b18..a3581aff1a7aad7c2911bc5abcc300000564a88c 100644 (file)
@@ -428,6 +428,20 @@ void MathCursor::plainErase()
 }
 
 
+void MathCursor::markInsert()
+{
+       //lyxerr << "inserting mark\n";
+       array().insert(pos(), MathAtom(new MathCharInset(0, lastcode_)));
+}
+
+
+void MathCursor::markErase()
+{
+       //lyxerr << "deleting mark\n";
+       array().erase(pos());
+}
+
+
 void MathCursor::plainInsert(MathAtom const & t)
 {
        array().insert(pos(), t);
@@ -571,8 +585,8 @@ void MathCursor::delLine()
                par()->asGridInset()->delRow(hullRow());
        }
 
-       if (idx() > par()->nargs())
-               idx() = par()->nargs();
+       if (idx() >= par()->nargs())
+               idx() = par()->nargs() - 1;
 
        if (pos() > size())
                pos() = size();
@@ -912,6 +926,8 @@ void MathCursor::pullArg(bool goright)
                array().insert(pos(), a);
                if (goright)
                        pos() += a.size();
+       } else {
+               formula()->mutateToText();
        }
 }
 
@@ -1263,7 +1279,7 @@ bool MathCursor::interpret(string const & s)
                m = std::max(1u, m);
                n = std::max(1u, n);
                v_align += 'c';
-               niceInsert(MathAtom(new MathArrayInset(m, n, v_align[0], h_align)));
+               niceInsert(MathAtom(new MathArrayInset("array", m, n, v_align[0], h_align)));
                return true;
        }
 
@@ -1375,6 +1391,8 @@ bool MathCursor::interpret(char c)
 
                if (c == '\\')
                        insert(c, LM_TC_TEX);
+               else
+                       insert(c, lastcode_);
 
                return true;
        }