http://bugzilla.lyx.org/show_bug.cgi?id=2202
Jean-Marc,
I found that the attached patch fixes the described crash for me. The cases
described in bug 2155 still work. However, I'm not really sure I got the
logic. Does this make sense to you?
Jürgen
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.638
diff -p -u -r1.638 text2.C
--- src/text2.C 23 Jan 2006 10:25:41 -0000 1.638
+++ src/text2.C 30 Jan 2006 14:50:41 -0000
@@ -1248,8 +1248,9 @@ bool LyXText::deleteEmptyParagraphMechan
if (oldpar.empty() || (oldpar.size() == 1 && oldpar.isLineSeparator(0))) {
// Delete old par.
- recordUndo(old, Undo::ATOMIC,
- old.pit(), min(old.pit() + 1, old.lastpit()));
+ recordUndo(old, Undo::ATOMIC,
+ std::max(old.pit() - 1, 0),
+ min(old.pit() + 1, old.lastpit()));
ParagraphList & plist = old.text()->paragraphs();
plist.erase(plist.begin() + old.pit());