From d9d0e7d5e86b4daa2aabef0425c8eddb085d823b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 29 Dec 2006 14:17:48 +0000 Subject: [PATCH] * 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 --- src/cursor.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.2