Skip to content

Commit

Permalink
Renamed 'Close Editor' => 'Close Tab in Main Area'
Browse files Browse the repository at this point in the history
  • Loading branch information
spoenemann committed Feb 11, 2020
1 parent ee18f93 commit 1add1bb
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions packages/core/src/browser/common-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ export namespace CommonCommands {
category: VIEW_CATEGORY,
label: 'Close All Tabs'
};
export const CLOSE_EDITOR: Command = {
id: 'core.close.editor',
export const CLOSE_MAIN_TAB: Command = {
id: 'core.close.main.tab',
category: VIEW_CATEGORY,
label: 'Close Editor'
label: 'Close Tab in Main Area'
};
export const CLOSE_OTHER_EDITORS: Command = {
id: 'core.close.other.editors',
export const CLOSE_OTHER_MAIN_TABS: Command = {
id: 'core.close.other.main.tabs',
category: VIEW_CATEGORY,
label: 'Close Other Editors'
label: 'Close Other Tabs in Main Area'
};
export const CLOSE_ALL_EDITORS: Command = {
id: 'core.close.all.editors',
export const CLOSE_ALL_MAIN_TABS: Command = {
id: 'core.close.all.main.tabs',
category: VIEW_CATEGORY,
label: 'Close All Editors'
label: 'Close All Tabs in Main Area'
};
export const COLLAPSE_PANEL: Command = {
id: 'core.collapse.tab',
Expand Down Expand Up @@ -383,10 +383,6 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
commandId: CommonCommands.AUTO_SAVE.id
});

registry.registerMenuAction(CommonMenus.FILE_CLOSE, {
commandId: CommonCommands.CLOSE_EDITOR.id
});

registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, 'Settings');

registry.registerMenuAction(CommonMenus.EDIT_UNDO, {
Expand Down Expand Up @@ -562,11 +558,11 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
isEnabled: (event?: Event) => this.findTabBar(event) !== undefined,
execute: (event?: Event) => this.shell.closeTabs(this.findTabArea(event)!)
});
commandRegistry.registerCommand(CommonCommands.CLOSE_EDITOR, {
commandRegistry.registerCommand(CommonCommands.CLOSE_MAIN_TAB, {
isEnabled: () => this.shell.getCurrentWidget('main') !== undefined,
execute: () => this.shell.getCurrentWidget('main')!.close()
});
commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_EDITORS, {
commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_MAIN_TABS, {
isEnabled: () => {
const tabBars = this.shell.mainAreaTabBars;
return tabBars.length > 1 || tabBars.length === 1 && tabBars[0].titles.length > 1;
Expand All @@ -578,7 +574,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
}
}
});
commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_EDITORS, {
commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_MAIN_TABS, {
isEnabled: () => this.shell.mainAreaTabBars.find(tb => tb.titles.length > 0) !== undefined,
execute: () => this.shell.closeTabs('main')
});
Expand Down Expand Up @@ -725,15 +721,15 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
keybinding: 'ctrlcmd+alt+a'
},
{
command: CommonCommands.CLOSE_EDITOR.id,
command: CommonCommands.CLOSE_MAIN_TAB.id,
keybinding: this.isElectron() ? (isWindows ? 'ctrl+f4' : 'ctrlcmd+w') : 'alt+w'
},
{
command: CommonCommands.CLOSE_OTHER_EDITORS.id,
command: CommonCommands.CLOSE_OTHER_MAIN_TABS.id,
keybinding: 'ctrlcmd+alt+t'
},
{
command: CommonCommands.CLOSE_ALL_EDITORS.id,
command: CommonCommands.CLOSE_ALL_MAIN_TABS.id,
keybinding: this.isElectron() ? 'ctrlCmd+k ctrlCmd+w' : 'alt+shift+w'
},
// Panels
Expand Down

0 comments on commit 1add1bb

Please sign in to comment.