]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.C
fix deletion of subscript if superscript is present and vice versa
[lyx.git] / src / mathed / formulabase.C
index 5cba2ecf434c13b42fe523e371074528a1cde6b3..18e1c97ba2a17f4b24e8e18d7bab9366309457b4 100644 (file)
@@ -447,25 +447,14 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                break;
 
        case LFUN_BACKSPACE:
-               // if (!mathcursor->inMacroMode() && mathcursor->pos() == 0)
-               if (mathcursor->pos() == 0) {
-                       bv->lockedInsetStoreUndo(Undo::DELETE);
-                       mathcursor->pullArg(false);
-                       bv->updateInset(this, true);
-                       break;
-               }
-               if (mathcursor->inMacroMode())
-                       mathcursor->left();
-               else
-                       mathcursor->plainLeft();
-               // fall through...
+               bv->lockedInsetStoreUndo(Undo::DELETE);
+               mathcursor->backspace();
+               bv->updateInset(this, true);
+               break;
 
        case LFUN_DELETE:
                bv->lockedInsetStoreUndo(Undo::DELETE);
-               if (mathcursor->pos() == mathcursor->array().size()) 
-                       mathcursor->pullArg(true);
-               else
-                       mathcursor->erase();
+               mathcursor->erase();
                bv->updateInset(this, true);
                break;
 
@@ -890,24 +879,6 @@ Inset::Code InsetFormulaBase::lyxCode() const
 }
 
 
-#if 0
-LyXFont const InsetFormulaBase::convertFont(LyXFont const & f) const
-{
-#warning Andre, you should be able to remove this now?
-       // or change it to
-#if 1
-       return f;
-#else
-       // (Lgb)
-       
-       // We have already discussed what was here
-       LyXFont font(f);
-       return font;
-#endif
-}
-#endif
-
-
 void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
 {
        if (bv->available()) {