mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-28 12:26:59 +00:00
Fix cursor position after redo
When document settings are modified, a command inset-forall Branch inset-toggle asign is run to open as needed all branches. At the end of the said loop, the cursor is reset to where it was. However, the cur_after undo element member is not set because it already had a value. To make this work as expected, it is necessary in LFUN_INSET_FORALL to reset the cursor before ending the undo group and to insert a dummy recordUndo call. Fixes bug #10097. (cherry picked from commit 0036762f30def16ab8b2216f721f9e552893bc85)
This commit is contained in:
parent
044933b0d9
commit
fe5e117038
@ -1850,9 +1850,17 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
if (!cur.nextInset() || cur.nextInset() == ins)
|
if (!cur.nextInset() || cur.nextInset() == ins)
|
||||||
cur.forwardInset();
|
cur.forwardInset();
|
||||||
}
|
}
|
||||||
cur.endUndoGroup();
|
|
||||||
cur = savecur;
|
cur = savecur;
|
||||||
cur.fixIfBroken();
|
cur.fixIfBroken();
|
||||||
|
/** This is a dummy undo record only to remember the cursor
|
||||||
|
* that has just been set; this will be used on a redo action
|
||||||
|
* (see ticket #10097)
|
||||||
|
|
||||||
|
* FIXME: a better fix would be to have a way to set the
|
||||||
|
* cursor value directly, but I am not sure it is worth it.
|
||||||
|
*/
|
||||||
|
cur.recordUndo();
|
||||||
|
cur.endUndoGroup();
|
||||||
dr.screenUpdate(Update::Force);
|
dr.screenUpdate(Update::Force);
|
||||||
dr.forceBufferUpdate();
|
dr.forceBufferUpdate();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user