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.

See r31199.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@31599 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-10-12 08:28:02 +00:00
parent a18553e403
commit 9078a80264
2 changed files with 6 additions and 3 deletions

View File

@ -544,7 +544,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();
@ -554,7 +554,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();

View File

@ -191,7 +191,10 @@ What's new
are present (bug 6264).
- Fix parsing of selection when used as argument of a math macro (bug 6270).
- Fix inset-[begin|end][-select] when the cursor is at the beginning or
end of a paragraph.
* DOCUMENTATION AND LOCALIZATION