From 9bb61acfd5e91098af9b63126c9b7c7e02723862 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 22 Aug 2009 14:34:50 +0000 Subject: [PATCH] Fix inset-begin and inset-end. Now, if the cursor was at the beginning of a paragraph in the middle of the inset, inset-begin would jump out of the inset. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31199 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index f89326cd1e..28be96930e 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -624,7 +624,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INSET_BEGIN: case LFUN_INSET_BEGIN_SELECT: needsUpdate |= cur.selHandle(cmd.action == LFUN_INSET_BEGIN_SELECT); - if (cur.depth() == 1 || cur.pos() > 0) + if (cur.depth() == 1 || !cur.top().at_begin()) needsUpdate |= cursorTop(cur); else cur.undispatched(); @@ -634,7 +634,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INSET_END: case LFUN_INSET_END_SELECT: needsUpdate |= cur.selHandle(cmd.action == LFUN_INSET_END_SELECT); - if (cur.depth() == 1 || cur.pos() < cur.lastpos()) + if (cur.depth() == 1 || !cur.top().at_end()) needsUpdate |= cursorBottom(cur); else cur.undispatched(); -- 2.39.2