fix issues with file menu commands (#11254)

This commit is contained in:
Anthony Dresser
2020-07-08 18:52:26 -07:00
committed by GitHub
parent 7176c7f42f
commit a69032e317

View File

@@ -625,7 +625,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler: async (accessor, args?: { viewType: string }) => {
const editorService = accessor.get(IEditorService);
if (args) {
if (args && args.viewType) { // {{SQL CARBON EDIT}} explicitly check for viewtype
const editorGroupsService = accessor.get(IEditorGroupsService);
const configurationService = accessor.get(IConfigurationService);
const quickInputService = accessor.get(IQuickInputService);
@@ -651,11 +651,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const configurationService = accessor.get(IConfigurationService);
const quickInputService = accessor.get(IQuickInputService);
const textInput = editorService.createEditorInput({ options: { pinned: true } });
const textInput = editorService.createEditorInput({ options: { pinned: true }, mode: 'txt' });
const group = editorGroupsService.activeGroup;
await openEditorWith(textInput, viewType, { pinned: true }, group, editorService, configurationService, quickInputService);
} else {
await editorService.openEditor({ options: { pinned: true } }); // untitled are always pinned
await editorService.openEditor({ options: { pinned: true }, mode: 'txt' }); // untitled are always pinned
}
}
});