Create close pane hotkey.

This commit is contained in:
Russell Myers 2019-04-15 21:16:54 -04:00
parent 11902020a5
commit 4949f14184
5 changed files with 13 additions and 0 deletions

View File

@ -222,6 +222,9 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
case 'split-nav-down': case 'split-nav-down':
this.navigate('b') this.navigate('b')
break break
case 'close-focus-pane':
this.removeTab(this.focusedTab)
break
} }
}) })
} }
@ -336,6 +339,8 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
if (this.root.children.length === 0) { if (this.root.children.length === 0) {
this.destroy() this.destroy()
} else {
this.focusAnyIn(parent)
} }
} }

View File

@ -50,4 +50,5 @@ hotkeys:
- 'Ctrl-Alt-ArrowUp' - 'Ctrl-Alt-ArrowUp'
split-nav-left: split-nav-left:
- 'Ctrl-Alt-ArrowLeft' - 'Ctrl-Alt-ArrowLeft'
close-focus-pane: []
pluginBlacklist: ['ssh'] pluginBlacklist: ['ssh']

View File

@ -48,4 +48,6 @@ hotkeys:
- '⌘-⌥-ArrowUp' - '⌘-⌥-ArrowUp'
split-nav-left: split-nav-left:
- '⌘-⌥-ArrowLeft' - '⌘-⌥-ArrowLeft'
close-focus-pane:
- '⌘-Shift-W'
pluginBlacklist: ['ssh'] pluginBlacklist: ['ssh']

View File

@ -50,4 +50,5 @@ hotkeys:
- 'Ctrl-Alt-ArrowUp' - 'Ctrl-Alt-ArrowUp'
split-nav-left: split-nav-left:
- 'Ctrl-Alt-ArrowLeft' - 'Ctrl-Alt-ArrowLeft'
close-focus-pane: []
pluginBlacklist: [] pluginBlacklist: []

View File

@ -109,6 +109,10 @@ export class AppHotkeyProvider extends HotkeyProvider {
id: 'split-nav-right', id: 'split-nav-right',
name: 'Focus the pane on the right', name: 'Focus the pane on the right',
}, },
{
id: 'close-focus-pane',
name: 'Close focused pane',
},
] ]
async provide (): Promise<IHotkeyDescription[]> { async provide (): Promise<IHotkeyDescription[]> {