>>>>> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> I have tried to enhance my witness a bit this year. Here's
Juergen> how I understand this case:

I think the problem is in DEPM: since it deletes a paragraph, the
recordUndo call should span two paragraphs (think about deleting a
selection that spans more than a paragraph).

I propose the following patch. What do you think?

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2351
diff -u -p -r1.2351 ChangeLog
--- src/ChangeLog	1 Jan 2006 23:06:22 -0000	1.2351
+++ src/ChangeLog	4 Jan 2006 11:36:04 -0000
@@ -1,3 +1,8 @@
+2006-01-04  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* text2.C (deleteEmptyParagraphMechanism): since we delete a
+	paragraph, recordUndo should span two paragraphs (bug 2155).
+
 2006-01-01  Martin Vermeer  <[EMAIL PROTECTED]>
 
 	* rowpainter.C (paintPar): always repaint the row with the
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.636
diff -u -p -r1.636 text2.C
--- src/text2.C	6 Dec 2005 14:54:23 -0000	1.636
+++ src/text2.C	4 Jan 2006 11:36:04 -0000
@@ -1234,7 +1234,8 @@ bool LyXText::deleteEmptyParagraphMechan
 
 	if (oldpar.empty() || (oldpar.size() == 1 && oldpar.isLineSeparator(0))) {
 		// Delete old par.
-		recordUndo(old, Undo::ATOMIC, old.pit());
+		recordUndo(old, Undo::ATOMIC, 
+			   old.pit(), min(old.pit() + 1, old.lastpit()));
 		ParagraphList & plist = old.text()->paragraphs();
 		plist.erase(plist.begin() + old.pit());
 

Reply via email to