mirror of
https://github.com/Microsoft/vscode
synced 2024-09-15 00:15:06 +00:00
Fix #24553. We should allow paste content besides the selection.
This commit is contained in:
parent
97e8bf8ca3
commit
8d3f2bf45b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue