提交 8d3f2bf4 编写于 作者: R rebornix

Fix #24553. We should allow paste content besides the selection.

上级 97e8bf8c
......@@ -123,7 +123,11 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
}
});
this._editor.setSelections(newSelections);
} else if (!this._dragSelection.containsPosition(newCursorPosition)) {
} else if (!this._dragSelection.containsPosition(newCursorPosition) || (
mouseEvent.event[DragAndDropController.TRIGGER_MODIFIER] && (
this._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition)
) // we allow users to paste content beside the selection
)) {
this._editor.executeCommand(DragAndDropController.ID, new DragAndDropCommand(this._dragSelection, newCursorPosition, mouseEvent.event[DragAndDropController.TRIGGER_MODIFIER]));
}
}
......
......@@ -30,7 +30,11 @@ export class DragAndDropCommand implements editorCommon.ICommand {
}
builder.addEditOperation(new Range(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), text);
if (this.selection.containsPosition(this.targetPosition)) {
if (this.selection.containsPosition(this.targetPosition) && !(
this.copy && (
this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)
) // we allow users to paste content beside the selection
)) {
this.targetSelection = this.selection;
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册