]> git.lyx.org Git - features.git/commitdiff
fix bug 2010 (boundary effects at the end of text insets)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 15 Sep 2005 13:53:38 +0000 (13:53 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 15 Sep 2005 13:53:38 +0000 (13:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10445 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index e90f83495dcdfadbf7035a209a029e74a6a093f7..48423098c0c699619d34f35e1cb4d0370de38399 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-13  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text2.C (cursorEnd, cursorRight): do not set boundary to true at
+       end of paragraph. (bug 2010)
+
 2005-09-10  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * text.C (leftMargin): check for inInset == 0
index 87795a7eec40c03d226ff8af4452ee528da33cb7..e8001c7c7bd1dfdead898756c8b05a440739ffed 100644 (file)
@@ -498,12 +498,13 @@ void LyXText::cursorEnd(LCursor & cur)
                // empty text, end-1 is no valid position
                return;
        bool boundary = false;
-       if (!cur.paragraph().isLineSeparator(end-1) &&
-           !cur.paragraph().isNewline(end-1))
-       {
-               boundary = true;
-       } else if (end != cur.lastpos())
-               --end;
+       if (end != cur.lastpos()) {
+               if (!cur.paragraph().isLineSeparator(end-1) 
+                       && !cur.paragraph().isNewline(end-1))
+                       boundary = true;
+               else
+                       --end;
+       }
        setCursor(cur, cur.pit(), end, true, boundary);
 }
 
@@ -1020,7 +1021,8 @@ bool LyXText::cursorRight(LCursor & cur)
        if (cur.pos() != cur.lastpos()) {
                bool updateNeeded = false;
                if (!checkAndActivateInset(cur, true)) {
-                       if (cur.textRow().endpos() == (cur.pos() + 1) &&
+                       if (cur.textRow().endpos() == cur.pos() + 1 &&
+                           cur.textRow().endpos() != cur.lastpos() &&
                            !cur.paragraph().isLineSeparator(cur.pos()) &&
                            !cur.paragraph().isNewline(cur.pos()))
                        {