case LFUN_GRAPHICS_GROUPS_UNIFY: {
if (cmd.argument().empty())
break;
- //view()->cursor().recordUndoFullDocument(); let inset-apply do that job
graphics::unifyGraphicsGroups(cur.buffer(), to_utf8(cmd.argument()));
processUpdateFlags(Update::Force | Update::FitCursor);
break;
case LFUN_NOTES_MUTATE: {
if (cmd.argument().empty())
break;
- cur.recordUndoFullDocument();
if (mutateNotes(cur, cmd.getArg(0), cmd.getArg(1))) {
processUpdateFlags(Update::Force);
// Put anchor at the same position.
cur.resetAnchor();
+ cur.beginUndoGroup();
+
// Try to dispatch to an non-editable inset near this position
// via the temp cursor. If the inset wishes to change the real
// cursor it has to do so explicitly by using
if (!inset || !cur.result().dispatched())
cur.dispatch(cmd);
+ cur.endUndoGroup();
+
// Notify left insets
if (cur != old) {
old.fixIfBroken();