mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
Merge pull request #225457 from mjbvz/yodelling-flyingfish
Enable copy paste api for readonly editors
This commit is contained in:
@@ -135,8 +135,7 @@ export class CopyPasteController extends Disposable implements IEditorContributi
|
||||
}
|
||||
|
||||
private isPasteAsEnabled(): boolean {
|
||||
return this._editor.getOption(EditorOption.pasteAs).enabled
|
||||
&& !this._editor.getOption(EditorOption.readOnly);
|
||||
return this._editor.getOption(EditorOption.pasteAs).enabled;
|
||||
}
|
||||
|
||||
public async finishedPaste(): Promise<void> {
|
||||
@@ -246,8 +245,8 @@ export class CopyPasteController extends Disposable implements IEditorContributi
|
||||
}
|
||||
|
||||
if (
|
||||
!this.isPasteAsEnabled()
|
||||
&& !this._pasteAsActionContext // Still enable if paste as was explicitly requested
|
||||
this._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly.
|
||||
|| (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user