The following patch fixes bug 2010:
http://bugzilla.lyx.org/show_bug.cgi?id=2010

This was an unintended consequence of the work Juergen V. did to allow
placing the cursor in front of a displayed inset.

Please test.

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2277
diff -u -p -r1.2277 ChangeLog
--- src/ChangeLog	10 Sep 2005 13:29:43 -0000	1.2277
+++ src/ChangeLog	13 Sep 2005 13:44:39 -0000
@@ -1,3 +1,8 @@
+2005-09-13  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* text2.C (cursorEnd, cursorRight): do not set boundary to true at
+	end of paragraph. (bug 2010)
+
 2005-09-10  Georg Baum  <[EMAIL PROTECTED]>
 
 	* text.C (leftMargin): check for inInset == 0
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.627
diff -u -p -r1.627 text2.C
--- src/text2.C	5 Sep 2005 06:50:42 -0000	1.627
+++ src/text2.C	13 Sep 2005 13:44:40 -0000
@@ -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);
 }
 
@@ -1021,6 +1022,7 @@ bool LyXText::cursorRight(LCursor & cur)
 		bool updateNeeded = false;
 		if (!checkAndActivateInset(cur, true)) {
 			if (cur.textRow().endpos() == (cur.pos() + 1) &&
+			    !cur.lastpos() == (cur.pos() + 1) &&
 			    !cur.paragraph().isLineSeparator(cur.pos()) &&
 			    !cur.paragraph().isNewline(cur.pos()))
 			{

Reply via email to