diff --git a/lib/codemirror.js b/lib/codemirror.js index c56e147eeb..ac0bd54078 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3660,6 +3660,7 @@ // Let the drag handler handle this. if (webkit) display.scroller.draggable = true; cm.state.draggingText = dragEnd; + dragEnd.copy = mac ? e.altKey : e.ctrlKey // IE's approach to draggable if (display.scroller.dragDrop) display.scroller.dragDrop(); on(document, "mouseup", dragEnd); @@ -3890,7 +3891,7 @@ try { var text = e.dataTransfer.getData("Text"); if (text) { - if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) + if (cm.state.draggingText && !cm.state.draggingText.copy) var selected = cm.listSelections(); setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) for (var i = 0; i < selected.length; ++i)