]> git.lyx.org Git - features.git/commitdiff
Fix backspace deletion of selected items with change tracking
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 13 Jan 2020 08:48:56 +0000 (09:48 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 27 Jan 2020 07:42:11 +0000 (08:42 +0100)
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

(cherry picked from commit adfd38e4efd1180df164fa2c75cf15210f366e94)

src/Text3.cpp
status.23x

index 393b556ad76f06d995f018a9d8d943f6af3c11d0..70646036ed0c95a836696f36cc9a5cf14f50bb07 100644 (file)
@@ -1193,7 +1193,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;
index 7b2e2a9886ab52d22fd1966643013b9d9b4d6649..63ad41d0a70ec440531b66d43a362cfebd3e1c74 100644 (file)
@@ -52,6 +52,8 @@ What's new
 
 * USER INTERFACE
 
+- Fix backspace deletion of selected items with change tracking (bug 11630).
+
 - Fix display glith where the change tracking cue blinks with the cursor
   (bug 11684).