Hi,

this patch fixes two problems with end-of-par handling. I tested it successfully and rigorously.

I already committed it to speed up development. If you think that something is wrong, I will revert the patch instantly.

Michael
Index: text.C
===================================================================
--- text.C	(Revision 16028)
+++ text.C	(Arbeitskopie)
@@ -1659,22 +1659,17 @@
 			cur.forwardPosNoDescend();
 		needsUpdate = true;
 	} else if (cur.pit() != cur.lastpit()) {
-		if (cur.buffer().params().trackChanges
-		    && par.isInserted(cur.pos())) {
-			// mark "carriage return" as deleted:
-			// FIXME: Change tracking (MG)
+		if (!par.isMergedOnEndOfParDeletion(cur.buffer().params().trackChanges)) {
 			par.setChange(cur.pos(), Change(Change::DELETED));
 			cur.forwardPos();
 			needsUpdate = true;
 		} else {
 			setCursorIntern(cur, cur.pit() + 1, 0);
 			needsUpdate = backspacePos0(cur);
-			// FIXME: Change tracking (MG)
-			if (cur.paragraph().isDeleted(cur.pos()))
-				cur.forwardPos();
 		}
-	} else
+	} else {
 		needsUpdate = dissolveInset(cur);
+	}
 
 	// FIXME: Inserting characters has nothing to do with setting a cursor.
 	// Because of the mix between the model (the paragraph contents)
@@ -1725,7 +1720,7 @@
 		needsUpdate = true;
 	}
 	// Pasting is not allowed, if the paragraphs have different
-	// layout. I think it is a real bug of all other
+	// layouts. I think it is a real bug of all other
 	// word processors to allow it. It confuses the user.
 	// Correction: Pasting is always allowed with standard-layout
 	else if (par.layout() == prevpar.layout()
@@ -1744,8 +1739,6 @@
 }
 
 
-
-
 bool LyXText::backspace(LCursor & cur)
 {
 	BOOST_ASSERT(this == cur.text());

Reply via email to