]> git.lyx.org Git - features.git/commitdiff
Martin's patch forn symmetric behaviour on backspace/erase
authorAndré Pönitz <poenitz@gmx.net>
Wed, 10 Dec 2003 10:22:27 +0000 (10:22 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 10 Dec 2003 10:22:27 +0000 (10:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8222 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_cursor.C

index 2d3400a699c5ea23095d0320112874d657b13960..726fcce0b983b39638f0f1875c3b7d37b3a34a42 100644 (file)
@@ -464,17 +464,24 @@ bool MathCursor::erase()
                if (inset()->idxDelete(idx()))
                        return true;
 
-       // old behaviour when in last position of cell
+       // special behaviour when in last position of cell
        if (pos() == size()) {
-               if (inset()->ncols() == 1 && inset()->nrows() == 1 && depth() == 1 && size() == 0)
+               bool one_cell = inset()->ncols() == 1 && inset()->nrows() == 1;
+               if (one_cell && depth() == 1 && size() == 0)
                        return false;
-               else{
+               // remove markup
+               if (one_cell)
+                       pullArg();
+               else
                        inset()->idxGlue(idx());
-                       return true;
-               }
+               return true;
        }
 
-       plainErase();
+       if (hasNextAtom() && nextAtom()->nargs() > 0)
+               right(true);
+       else
+               plainErase();
+
        return true;
 }