mirror of
https://github.com/Eugeny/tabby
synced 2024-12-13 14:52:45 +00:00
added hotkeys to loop through panes - fixes #3417
This commit is contained in:
parent
6197215500
commit
0452f42c41
5 changed files with 37 additions and 0 deletions
|
@ -238,6 +238,12 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
|
|||
case 'pane-nav-down':
|
||||
this.navigate('b')
|
||||
break
|
||||
case 'pane-nav-previous':
|
||||
this.navigateLinear(-1)
|
||||
break
|
||||
case 'pane-nav-next':
|
||||
this.navigateLinear(1)
|
||||
break
|
||||
case 'pane-maximize':
|
||||
if (this.maximizedTab) {
|
||||
this.maximize(null)
|
||||
|
@ -433,6 +439,17 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
|
|||
}
|
||||
}
|
||||
|
||||
navigateLinear (delta: number): void {
|
||||
if (!this.focusedTab) {
|
||||
return
|
||||
}
|
||||
|
||||
const relativeTo: BaseTabComponent = this.focusedTab
|
||||
const all = this.getAllTabs()
|
||||
const target = all[(all.indexOf(relativeTo) + delta + all.length) % all.length]
|
||||
this.focus(target)
|
||||
}
|
||||
|
||||
async splitTab (tab: BaseTabComponent, dir: SplitDirection): Promise<BaseTabComponent|null> {
|
||||
const newTab = await this.tabsService.duplicate(tab)
|
||||
if (newTab) {
|
||||
|
|
|
@ -62,6 +62,10 @@ hotkeys:
|
|||
- 'Ctrl-Alt-Up'
|
||||
pane-nav-left:
|
||||
- 'Ctrl-Alt-Left'
|
||||
pane-nav-previous:
|
||||
- 'Ctrl-Alt-['
|
||||
pane-nav-next:
|
||||
- 'Ctrl-Alt-]'
|
||||
pane-maximize:
|
||||
- 'Ctrl-Alt-Enter'
|
||||
close-pane: []
|
||||
|
|
|
@ -60,6 +60,10 @@ hotkeys:
|
|||
- '⌘-⌥-Up'
|
||||
pane-nav-left:
|
||||
- '⌘-⌥-Left'
|
||||
pane-nav-previous:
|
||||
- '⌘-⌥-['
|
||||
pane-nav-next:
|
||||
- '⌘-⌥-]'
|
||||
pane-maximize:
|
||||
- '⌘-⌥-Enter'
|
||||
close-pane:
|
||||
|
|
|
@ -63,6 +63,10 @@ hotkeys:
|
|||
- 'Ctrl-Alt-Up'
|
||||
pane-nav-left:
|
||||
- 'Ctrl-Alt-Left'
|
||||
pane-nav-previous:
|
||||
- 'Ctrl-Alt-['
|
||||
pane-nav-next:
|
||||
- 'Ctrl-Alt-]'
|
||||
pane-maximize:
|
||||
- 'Ctrl-Alt-Enter'
|
||||
close-pane: []
|
||||
|
|
|
@ -157,6 +157,14 @@ export class AppHotkeyProvider extends HotkeyProvider {
|
|||
id: 'pane-nav-right',
|
||||
name: 'Focus the pane on the right',
|
||||
},
|
||||
{
|
||||
id: 'pane-nav-previous',
|
||||
name: 'Focus previous pane',
|
||||
},
|
||||
{
|
||||
id: 'pane-nav-next',
|
||||
name: 'Focus next pane',
|
||||
},
|
||||
{
|
||||
id: 'close-pane',
|
||||
name: 'Close focused pane',
|
||||
|
|
Loading…
Reference in a new issue