[LyX/master] Fix backspace deletion of selected items with change tracking

Juergen Spitzmueller spitz at lyx.org
Mon Jan 13 08:34:31 UTC 2020


commit adfd38e4efd1180df164fa2c75cf15210f366e94
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Jan 13 09:48:56 2020 +0100

    Fix backspace deletion of selected items with change tracking
    
    Move cursor at beginning of selection after deletion. Else backspace
    operation gets stuck in a loop (tries to remove the selection again
    and again).
    
    This also fixes backspace deletion of insets with confirmDeletion() == true.
    
    Fixes #11630
---
 src/Text3.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 664ffb4..8643411 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1250,7 +1250,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 				}
 			}
 		} else {
+			DocIterator const dit = cur.selectionBegin();
 			cutSelection(cur, false);
+			if (cur.buffer()->params().track_changes)
+				// since we're doing backwards deletion,
+				// and the selection is not really cut,
+				// move cursor before selection (#11630)
+				cur.setCursor(dit);
 			singleParUpdate = false;
 		}
 		break;


More information about the lyx-cvs mailing list