#include "frontends/Painter.h"
#include "frontends/Selection.h"
-#include "frontends/nullpainter.h"
#include "funcrequest.h"
#include "lyxserver.h"
recordUndoInset(cur, Undo::ATOMIC);
else
recordUndo(cur, Undo::ATOMIC);
- cur.backspace();
+ // if the inset can not be removed from within, delete it
+ if (!cur.backspace()) {
+ FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD);
+ cur.bv().getLyXText()->dispatch(cur, cmd);
+ }
break;
case LFUN_WORD_DELETE_FORWARD:
recordUndoInset(cur, Undo::ATOMIC);
else
recordUndo(cur, Undo::ATOMIC);
- cur.erase();
+ // if the inset can not be removed from within, delete it
+ if (!cur.erase()) {
+ FuncRequest cmd = FuncRequest(LFUN_CHAR_DELETE_FORWARD);
+ cur.bv().getLyXText()->dispatch(cur, cmd);
+ }
break;
case LFUN_ESCAPE:
}
--cur.pos();
InsetMathScript * inset = cur.nextAtom().nucleus()->asScriptInset();
- // special handling of {}-bases
- // is this always correct?
- if (inset->nuc().size() == 1
- && inset->nuc().back()->asBraceInset())
- inset->nuc() = inset->nuc().back()->asNestInset()->cell(0);
+ // See comment in MathParser.C for special handling of {}-bases
cur.push(*inset);
cur.idx() = 1;