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
This commit is contained in:
Vincent van Ravesteijn 2009-08-22 14:34:50 +00:00
parent 48568fef53
commit 9bb61acfd5

View File

@ -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();