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':
|
case 'pane-nav-down':
|
||||||
this.navigate('b')
|
this.navigate('b')
|
||||||
break
|
break
|
||||||
|
case 'pane-nav-previous':
|
||||||
|
this.navigateLinear(-1)
|
||||||
|
break
|
||||||
|
case 'pane-nav-next':
|
||||||
|
this.navigateLinear(1)
|
||||||
|
break
|
||||||
case 'pane-maximize':
|
case 'pane-maximize':
|
||||||
if (this.maximizedTab) {
|
if (this.maximizedTab) {
|
||||||
this.maximize(null)
|
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> {
|
async splitTab (tab: BaseTabComponent, dir: SplitDirection): Promise<BaseTabComponent|null> {
|
||||||
const newTab = await this.tabsService.duplicate(tab)
|
const newTab = await this.tabsService.duplicate(tab)
|
||||||
if (newTab) {
|
if (newTab) {
|
||||||
|
|
|
@ -62,6 +62,10 @@ hotkeys:
|
||||||
- 'Ctrl-Alt-Up'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-Left'
|
- 'Ctrl-Alt-Left'
|
||||||
|
pane-nav-previous:
|
||||||
|
- 'Ctrl-Alt-['
|
||||||
|
pane-nav-next:
|
||||||
|
- 'Ctrl-Alt-]'
|
||||||
pane-maximize:
|
pane-maximize:
|
||||||
- 'Ctrl-Alt-Enter'
|
- 'Ctrl-Alt-Enter'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
|
|
|
@ -60,6 +60,10 @@ hotkeys:
|
||||||
- '⌘-⌥-Up'
|
- '⌘-⌥-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- '⌘-⌥-Left'
|
- '⌘-⌥-Left'
|
||||||
|
pane-nav-previous:
|
||||||
|
- '⌘-⌥-['
|
||||||
|
pane-nav-next:
|
||||||
|
- '⌘-⌥-]'
|
||||||
pane-maximize:
|
pane-maximize:
|
||||||
- '⌘-⌥-Enter'
|
- '⌘-⌥-Enter'
|
||||||
close-pane:
|
close-pane:
|
||||||
|
|
|
@ -63,6 +63,10 @@ hotkeys:
|
||||||
- 'Ctrl-Alt-Up'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-Left'
|
- 'Ctrl-Alt-Left'
|
||||||
|
pane-nav-previous:
|
||||||
|
- 'Ctrl-Alt-['
|
||||||
|
pane-nav-next:
|
||||||
|
- 'Ctrl-Alt-]'
|
||||||
pane-maximize:
|
pane-maximize:
|
||||||
- 'Ctrl-Alt-Enter'
|
- 'Ctrl-Alt-Enter'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
|
|
|
@ -157,6 +157,14 @@ export class AppHotkeyProvider extends HotkeyProvider {
|
||||||
id: 'pane-nav-right',
|
id: 'pane-nav-right',
|
||||||
name: 'Focus the pane on the 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',
|
id: 'close-pane',
|
||||||
name: 'Close focused pane',
|
name: 'Close focused pane',
|
||||||
|
|
Loading…
Reference in a new issue