提交 6472a8af 编写于 作者: I isidor

open editors: compare selected

上级 ab712fdf
...@@ -241,7 +241,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { ...@@ -241,7 +241,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
title: nls.localize('compareWithSaved', "Compare with Saved"), title: nls.localize('compareWithSaved', "Compare with Saved"),
precondition: DirtyEditorContext precondition: DirtyEditorContext
}, },
when: ContextKeyExpr.and(ResourceContextKey.IsFile, AutoSaveContext.notEqualsTo('afterDelay')) when: ContextKeyExpr.and(ResourceContextKey.IsFile, AutoSaveContext.notEqualsTo('afterDelay'), WorkbenchListDoubleSelection.toNegated())
}); });
const compareResourceCommand = { const compareResourceCommand = {
...@@ -252,7 +252,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { ...@@ -252,7 +252,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '3_compare', group: '3_compare',
order: 20, order: 20,
command: compareResourceCommand, command: compareResourceCommand,
when: ContextKeyExpr.and(ResourceContextKey.HasResource, ResourceSelectedForCompareContext) when: ContextKeyExpr.and(ResourceContextKey.IsFile, ResourceSelectedForCompareContext, WorkbenchListDoubleSelection.toNegated())
}); });
const selectForCompareCommand = { const selectForCompareCommand = {
...@@ -263,7 +263,18 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { ...@@ -263,7 +263,18 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '3_compare', group: '3_compare',
order: 30, order: 30,
command: selectForCompareCommand, command: selectForCompareCommand,
when: ResourceContextKey.HasResource when: ContextKeyExpr.and(ResourceContextKey.IsFile, WorkbenchListDoubleSelection.toNegated())
});
const compareSelectedCommand = {
id: COMPARE_SELECTED_COMMAND_ID,
title: nls.localize('compareSelected', "Compare Selected")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: '3_compare',
order: 30,
command: compareSelectedCommand,
when: ContextKeyExpr.and(ResourceContextKey.IsFile, WorkbenchListDoubleSelection)
}); });
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
...@@ -357,10 +368,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { ...@@ -357,10 +368,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: '3_compare', group: '3_compare',
order: 30, order: 30,
command: { command: compareSelectedCommand,
id: COMPARE_SELECTED_COMMAND_ID,
title: nls.localize('compareSelected', "Compare Selected")
},
when: ContextKeyExpr.and(ExplorerFolderContext.toNegated(), ResourceContextKey.IsFile, WorkbenchListDoubleSelection) when: ContextKeyExpr.and(ExplorerFolderContext.toNegated(), ResourceContextKey.IsFile, WorkbenchListDoubleSelection)
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册