mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
* 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:
parent
c4b009a248
commit
66d7479e86
@ -695,9 +695,9 @@ bool InsetMathScript::notifyCursorLeaves(Cursor & cur)
|
|||||||
int scriptSlice
|
int scriptSlice
|
||||||
= cur.bv().cursor().find(this);
|
= cur.bv().cursor().find(this);
|
||||||
BOOST_ASSERT(scriptSlice != -1);
|
BOOST_ASSERT(scriptSlice != -1);
|
||||||
Cursor scriptCur = cur.bv().cursor();
|
Cursor & bvCur = cur.bv().cursor();
|
||||||
scriptCur.cutOff(scriptSlice);
|
bvCur.cutOff(scriptSlice);
|
||||||
scriptCur.recordUndoInset();
|
bvCur.recordUndoInset();
|
||||||
|
|
||||||
// Let the script inset commit suicide. This is
|
// Let the script inset commit suicide. This is
|
||||||
// modelled on Cursor.pullArg(), but tries not to
|
// 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
|
// cur (since the top slice will be deleted
|
||||||
// afterwards)
|
// afterwards)
|
||||||
MathData ar = cell(0);
|
MathData ar = cell(0);
|
||||||
scriptCur.pop();
|
bvCur.pop();
|
||||||
scriptCur.cell().erase(scriptCur.pos());
|
bvCur.cell().erase(bvCur.pos());
|
||||||
scriptCur.cell().insert(scriptCur.pos(), ar);
|
bvCur.cell().insert(bvCur.pos(), ar);
|
||||||
|
|
||||||
|
// put cursor behind
|
||||||
|
bvCur.pos() += ar.size();
|
||||||
|
|
||||||
|
// redraw
|
||||||
cur.updateFlags(cur.disp_.update() | Update::SinglePar);
|
cur.updateFlags(cur.disp_.update() | Update::SinglePar);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user