From: Jean-Marc Lasgouttes Date: Fri, 29 Dec 2006 14:17:48 +0000 (+0000) Subject: * cursor.C (popRight): place cursor at the right spot: X-Git-Tag: 1.6.10~11420 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d9d0e7d5e86b4daa2aabef0425c8eddb085d823b;p=features.git * 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 --- diff --git a/src/cursor.C b/src/cursor.C index 5bccc4d13b..3146935b47 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -374,11 +374,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; }