feat: hotkey-restart-tab, remove restart menu

This commit is contained in:
Qiming-Liu 2022-07-06 13:59:58 +09:30 committed by Eugene
parent aa5970b12d
commit c3abff56aa
6 changed files with 11 additions and 11 deletions

View File

@ -112,6 +112,10 @@ export class AppRootComponent {
if (hotkey === 'duplicate-tab') {
this.app.duplicateTab(this.app.activeTab)
}
if (hotkey === 'restart-tab') {
this.app.duplicateTab(this.app.activeTab)
this.app.closeTab(this.app.activeTab, true)
}
if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) {
this.app.explodeTab(this.app.activeTab)
}

View File

@ -21,6 +21,7 @@ hotkeys:
rearrange-panes:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
explode-tab:
- 'Ctrl-Shift-.'
combine-tabs:

View File

@ -39,6 +39,7 @@ hotkeys:
tab-10:
- '⌘-0'
duplicate-tab: []
restart-tab: []
explode-tab:
- '⌘-Shift-.'
combine-tabs:

View File

@ -22,6 +22,7 @@ hotkeys:
rearrange-panes:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
explode-tab:
- 'Ctrl-Shift-.'
combine-tabs:

View File

@ -56,6 +56,10 @@ export class AppHotkeyProvider extends HotkeyProvider {
id: 'duplicate-tab',
name: this.translate.instant('Duplicate tab'),
},
{
id: 'restart-tab',
name: this.translate.instant('Restart tab'),
},
{
id: 'explode-tab',
name: this.translate.instant('Turn current tab\'s panes into separate tabs'),

View File

@ -120,17 +120,6 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
label: this.translate.instant('Duplicate'),
click: () => this.app.duplicateTab(tab),
},
{
label: this.translate.instant('Restart'),
click: () => {
this.app.duplicateTab(tab)
if (this.app.tabs.includes(tab)) {
this.app.closeTab(tab, true)
} else {
tab.destroy()
}
},
},
{
label: this.translate.instant('Color'),
sublabel: currentColor ? this.translate.instant(currentColor) : undefined,