提交 d2c6e376 编写于 作者: B Benjamin Pasero 提交者: Benjamin Pasero

Unable to copy files across VSCode windows in 1.31 (fixes #68031) (#68104)

上级 33eef88b
......@@ -115,7 +115,7 @@ const PASTE_FILE_ID = 'filesExplorer.paste';
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: PASTE_FILE_ID,
weight: KeybindingWeight.WorkbenchContrib + explorerCommandsWeightBonus,
when: ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceNotReadonlyContext, FileCopiedContext),
when: ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceNotReadonlyContext),
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
handler: pasteFileHandler
});
......
......@@ -45,6 +45,7 @@ import { createFileIconThemableTreeContainerScope } from 'vs/workbench/browser/p
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IAsyncDataTreeViewState } from 'vs/base/browser/ui/tree/asyncDataTree';
import { FuzzyScore } from 'vs/base/common/filters';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
export class ExplorerView extends ViewletPanel {
static readonly ID: string = 'workbench.explorer.fileView';
......@@ -84,7 +85,8 @@ export class ExplorerView extends ViewletPanel {
@IMenuService private readonly menuService: IMenuService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IExplorerService private readonly explorerService: IExplorerService,
@IStorageService private readonly storageService: IStorageService
@IStorageService private readonly storageService: IStorageService,
@IClipboardService private clipboardService: IClipboardService
) {
super({ ...(options as IViewletPanelOptions), id: ExplorerView.ID, ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService);
......@@ -398,6 +400,9 @@ export class ExplorerView extends ViewletPanel {
private onContextMenu(e: ITreeContextMenuEvent<ExplorerItem>): void {
const stat = e.element;
// update dynamic contexts
this.fileCopiedContextKey.set(this.clipboardService.hasResources());
const selection = this.tree.getSelection();
this.contextMenuService.showContextMenu({
getAnchor: () => e.anchor,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册