]> git.lyx.org Git - features.git/commitdiff
Use correct cursor when creating undo group
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 29 Aug 2023 15:23:22 +0000 (17:23 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 29 Aug 2023 15:25:51 +0000 (17:25 +0200)
This affects where cursor will be after undo. In this case, we want
obviously the 'old' cursor.

Fixes bug #12874.

src/BufferView.cpp

index 28577f231f535f0a405ea7afc63fe2f40148aede..9ec5df3bef7dea9fcca8d5e2a8233856928c78e0 100644 (file)
@@ -2651,7 +2651,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
        // Put anchor at the same position.
        cur.resetAnchor();
 
-       cur.beginUndoGroup();
+       old.beginUndoGroup();
 
        // Try to dispatch to an non-editable inset near this position
        // via the temp cursor. If the inset wishes to change the real
@@ -2673,7 +2673,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
                        cursor().fixIfBroken();
        }
 
-       cur.endUndoGroup();
+       old.endUndoGroup();
 
        // Do we have a selection?
        theSelection().haveSelection(cursor().selection());