]> git.lyx.org Git - features.git/commitdiff
Fix inset-begin and inset-end. Now, if the cursor was at the beginning of a paragraph...
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 22 Aug 2009 14:34:50 +0000 (14:34 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 22 Aug 2009 14:34:50 +0000 (14:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31199 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index f89326cd1ed0bc22819f03523610c8cd74bbbca0..28be96930e238f9fb29bdc9c0c8235bea9c7fe83 100644 (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();