>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
Jean-Marc> The following patch fixes the crash described in the bug:
Jean-Marc> popRight should not blindly go one step on the right, since
Jean-Marc> notifyCursorLeave may cause a script inset to commit
Jean-Marc> suicide. The situation is still not perfect if the nucleus
Jean-Marc> contained more than one character, but I think it will have
Jean-Marc> to do for now.
Jean-Marc> I'll commit tomorrow if nobody complains.
Jean-Marc> This new version is not as nice, but it should work in all
Jean-Marc> situations. I'll commit later today.
Hmph.
JMarc
Index: src/cursor.C
===================================================================
--- src/cursor.C (revision 16422)
+++ src/cursor.C (working copy)
@@ -360,11 +360,12 @@ bool LCursor::popRight()
{
BOOST_ASSERT(!empty());
//lyxerr << "Leaving inset to the right" << endl;
+ const pos_type lp = (depth() > 1) ? (*this)[depth() - 2].lastpos() : 0;
inset().notifyCursorLeaves(*this);
if (depth() == 1)
return false;
pop();
- ++pos();
+ pos() += lastpos() - lp + 1;
return true;
}