+ // Has the cursor just left the inset?
+ if (&cursor().inset() != &cur.inset())
+ cursor().inset().notifyCursorLeaves(cursor());
+
+ // do the dEPM magic if needed
+ if (cursor().inTexted())
+ cursor().text()->deleteEmptyParagraphMechanism(cur, cursor());
+
+ cursor() = cur;
+ cursor().clearSelection();
+ cursor().setTargetX();
+ finishUndo();
+
+}