[LyX/master] Do not track deletion of empty paragraph

Juergen Spitzmueller spitz at lyx.org
Sat Jan 11 16:55:20 UTC 2020


commit ac8aa981db4f0396169d5573e354a92a42ffa5d2
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jan 11 18:11:26 2020 +0100

    Do not track deletion of empty paragraph
    
    Fixes #10412
---
 src/Text.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/Text.cpp b/src/Text.cpp
index 7b7e67b..6d5f7dd 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -1733,7 +1733,8 @@ bool Text::backspace(Cursor & cur)
 		Cursor prev_cur = cur;
 		--prev_cur.pit();
 
-		if (!prev_cur.paragraph().isMergedOnEndOfParDeletion(cur.buffer()->params().track_changes)) {
+		if (cur.paragraph().size() > 0
+		    && !prev_cur.paragraph().isMergedOnEndOfParDeletion(cur.buffer()->params().track_changes)) {
 			cur.recordUndo(prev_cur.pit(), prev_cur.pit());
 			prev_cur.paragraph().setChange(prev_cur.lastpos(), Change(Change::DELETED));
 			setCursorIntern(cur, prev_cur.pit(), prev_cur.lastpos());


More information about the lyx-cvs mailing list