* cursor.C (popRight): place cursor at the right spot:

notifyCursorLeaves may have killed the inset and put its contents
	at lower level (bug 2908)



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16430 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2006-12-29 14:17:48 +00:00
parent ec4ff5e1a8
commit d9d0e7d5e8

View File

@ -374,11 +374,12 @@ bool LCursor::popRight()
{ {
BOOST_ASSERT(!empty()); BOOST_ASSERT(!empty());
//lyxerr << "Leaving inset to the right" << endl; //lyxerr << "Leaving inset to the right" << endl;
const pos_type lp = (depth() > 1) ? (*this)[depth() - 2].lastpos() : 0;
inset().notifyCursorLeaves(*this); inset().notifyCursorLeaves(*this);
if (depth() == 1) if (depth() == 1)
return false; return false;
pop(); pop();
++pos(); pos() += lastpos() - lp + 1;
return true; return true;
} }