-/*
-if the fitCursor call refers to some point in never-explored-land, then we
-don't have y information in insets there, then we cannot even do an update
-to get it (because we need the y infomation for setting top_y first). So
-this is solved in putSelectionAt with:
+void BufferView::mouseSetCursor(LCursor & cur)
+{
+ BOOST_ASSERT(&cur.bv() == this);
+
+ // 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();