From 6572d0d6614d3a724173647918ea195a5eaa0ba7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 15 Sep 2005 13:53:38 +0000 Subject: [PATCH] fix bug 2010 (boundary effects at the end of text insets) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10445 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/text2.C | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e90f83495d..48423098c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-09-13 Jean-Marc Lasgouttes + + * text2.C (cursorEnd, cursorRight): do not set boundary to true at + end of paragraph. (bug 2010) + 2005-09-10 Georg Baum * text.C (leftMargin): check for inInset == 0 diff --git a/src/text2.C b/src/text2.C index 87795a7eec..e8001c7c7b 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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())) { -- 2.39.2