Jean-Marc Lasgouttes wrote:
> I was about to post almost the same patch :)
Good :-)
> I think yours is just as good. You should probably add a 'using
> std::max' somewhere, though.
Done. What about the attached patch? Can it be applied?
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 15:42:04 -0000
@@ -63,6 +63,7 @@ using lyx::pos_type;
using std::endl;
using std::ostringstream;
using std::string;
+using std::max;
using std::min;
@@ -1248,8 +1249,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,
+ max(old.pit() - 1, 0),
+ min(old.pit() + 1, old.lastpit()));
ParagraphList & plist = old.text()->paragraphs();
plist.erase(plist.begin() + old.pit());