From 66d7479e86e3509168d3bfa11db4599bad5b5595 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Sat, 9 Feb 2008 23:20:11 +0000 Subject: [PATCH] * 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 --- src/mathed/InsetMathScript.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 246695e043..c146e071b1 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -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; } -- 2.39.2