diff --git a/src/BufferView.cpp b/src/BufferView.cpp index d5fa198678..e20b0a7978 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2678,11 +2678,6 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0) // LFUN_FILE_OPEN generated by drag-and-drop. FuncRequest cmd = cmd0; - Cursor old = cursor(); - Cursor cur(*this); - cur.push(buffer_.inset()); - cur.selection(d->cursor_.selection()); - // Either the inset under the cursor or the // surrounding Text will handle this event. @@ -2700,6 +2695,11 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0) return; } + Cursor old = cursor(); + Cursor cur(*this); + cur.push(buffer_.inset()); + cur.selection(d->cursor_.selection()); + // Build temporary cursor. Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x(), cmd.y()); if (inset) {