File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/vs/editor/contrib/dropOrPasteInto/browser Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,18 @@ export class CopyPasteController extends Disposable implements IEditorContributi
114114 }
115115
116116 private handleCopy ( e : ClipboardEvent ) {
117- if ( ! e . clipboardData || ! this . _editor . hasTextFocus ( ) || ! this . isPasteAsEnabled ( ) ) {
117+ if ( ! this . _editor . hasTextFocus ( ) ) {
118+ return ;
119+ }
120+
121+ if ( platform . isWeb ) {
122+ // Explicitly clear the web resources clipboard.
123+ // This is needed because on web, the browser clipboard is faked out using an in-memory store.
124+ // This means the resources clipboard is not properly updated when copying from the editor.
125+ this . _clipboardService . writeResources ( [ ] ) ;
126+ }
127+
128+ if ( ! e . clipboardData || ! this . isPasteAsEnabled ( ) ) {
118129 return ;
119130 }
120131
You can’t perform that action at this time.
0 commit comments