* change the BufferView cursor to avoid later "successful" fixIfBroken calls

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22911 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-02-09 23:20:11 +00:00
parent c4b009a248
commit 66d7479e86

View File

@ -695,9 +695,9 @@ bool InsetMathScript::notifyCursorLeaves(Cursor & cur)
int scriptSlice
= cur.bv().cursor().find(this);
BOOST_ASSERT(scriptSlice != -1);
Cursor scriptCur = cur.bv().cursor();
scriptCur.cutOff(scriptSlice);
scriptCur.recordUndoInset();
Cursor & bvCur = cur.bv().cursor();
bvCur.cutOff(scriptSlice);
bvCur.recordUndoInset();
// Let the script inset commit suicide. This is
// modelled on Cursor.pullArg(), but tries not to
@ -705,9 +705,14 @@ bool InsetMathScript::notifyCursorLeaves(Cursor & cur)
// cur (since the top slice will be deleted
// afterwards)
MathData ar = cell(0);
scriptCur.pop();
scriptCur.cell().erase(scriptCur.pos());
scriptCur.cell().insert(scriptCur.pos(), ar);
bvCur.pop();
bvCur.cell().erase(bvCur.pos());
bvCur.cell().insert(bvCur.pos(), ar);
// put cursor behind
bvCur.pos() += ar.size();
// redraw
cur.updateFlags(cur.disp_.update() | Update::SinglePar);
return true;
}