disable compare action when no active file, no need for notification
#119463
This commit is contained in:
parent
853f917190
commit
479a224741
2 changed files with 1 additions and 4 deletions
|
@ -36,7 +36,7 @@ import { Codicon } from 'vs/base/common/codicons';
|
|||
const category = { value: nls.localize('filesCategory', "File"), original: 'File' };
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(GlobalCompareResourcesAction), 'File: Compare Active File With...', category.value);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(GlobalCompareResourcesAction), 'File: Compare Active File With...', category.value, ActiveEditorContext);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusFilesExplorer), 'File: Focus on Files Explorer', category.value);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowActiveFileInExplorer), 'File: Reveal Active File in Side Bar', category.value);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(CompareWithClipboardAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_C) }), 'File: Compare Active File with Clipboard', category.value);
|
||||
|
|
|
@ -443,7 +443,6 @@ export class GlobalCompareResourcesAction extends Action {
|
|||
label: string,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@ITextModelService private readonly textModelService: ITextModelService
|
||||
) {
|
||||
super(id, label);
|
||||
|
@ -490,8 +489,6 @@ export class GlobalCompareResourcesAction extends Action {
|
|||
|
||||
// Bring up quick access
|
||||
this.quickInputService.quickAccess.show('', { itemActivation: ItemActivation.SECOND });
|
||||
} else {
|
||||
this.notificationService.warn(nls.localize('openFileToCompare', "Open a file first to compare it with another file."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue