File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ func (gui *Gui) resetHelpersAndControllers() {
197197 commandLogController := controllers .NewCommandLogController (common )
198198 confirmationController := controllers .NewConfirmationController (common )
199199 suggestionsController := controllers .NewSuggestionsController (common )
200- jumpToSideWindowController := controllers .NewJumpToSideWindowController (common )
200+ jumpToSideWindowController := controllers .NewJumpToSideWindowController (common , gui . handleNextTab )
201201
202202 sideWindowControllerFactory := controllers .NewSideWindowControllerFactory (common )
203203
Original file line number Diff line number Diff line change @@ -10,15 +10,18 @@ import (
1010
1111type JumpToSideWindowController struct {
1212 baseController
13- c * ControllerCommon
13+ c * ControllerCommon
14+ nextTabFunc func () error
1415}
1516
1617func NewJumpToSideWindowController (
1718 c * ControllerCommon ,
19+ nextTabFunc func () error ,
1820) * JumpToSideWindowController {
1921 return & JumpToSideWindowController {
2022 baseController : baseController {},
2123 c : c ,
24+ nextTabFunc : nextTabFunc ,
2225 }
2326}
2427
@@ -46,6 +49,10 @@ func (self *JumpToSideWindowController) GetKeybindings(opts types.KeybindingsOpt
4649
4750func (self * JumpToSideWindowController ) goToSideWindow (window string ) func () error {
4851 return func () error {
52+ if self .c .Helpers ().Window .CurrentWindow () == window {
53+ return self .nextTabFunc ()
54+ }
55+
4956 context := self .c .Helpers ().Window .GetContextForWindow (window )
5057
5158 return self .c .PushContext (context )
Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ var tests = []*components.IntegrationTest{
338338 ui .OpenLinkFailure ,
339339 ui .RangeSelect ,
340340 ui .SwitchTabFromMenu ,
341+ ui .SwitchTabWithPanelJumpKeys ,
341342 undo .UndoCheckoutAndDrop ,
342343 undo .UndoDrop ,
343344 worktree .AddFromBranch ,
Original file line number Diff line number Diff line change 1+ package ui
2+
3+ import (
4+ "github.com/jesseduffield/lazygit/pkg/config"
5+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
6+ )
7+
8+ var SwitchTabWithPanelJumpKeys = NewIntegrationTest (NewIntegrationTestArgs {
9+ Description : "Switch tab with the panel jump keys" ,
10+ ExtraCmdArgs : []string {},
11+ Skip : false ,
12+ SetupConfig : func (config * config.AppConfig ) {},
13+ SetupRepo : func (shell * Shell ) {
14+ },
15+ Run : func (t * TestDriver , keys config.KeybindingConfig ) {
16+ t .Views ().Worktrees ().Focus ().
17+ Press (keys .Universal .JumpToBlock [2 ])
18+
19+ t .Views ().Branches ().IsFocused ().
20+ Press (keys .Universal .JumpToBlock [2 ])
21+
22+ t .Views ().Remotes ().IsFocused ().
23+ Press (keys .Universal .JumpToBlock [2 ])
24+
25+ t .Views ().Tags ().IsFocused ().
26+ Press (keys .Universal .JumpToBlock [2 ])
27+
28+ t .Views ().Branches ().IsFocused ().
29+ Press (keys .Universal .JumpToBlock [1 ])
30+
31+ // When jumping to a panel from a different one, keep its current tab:
32+ t .Views ().Worktrees ().IsFocused ()
33+ },
34+ })
You can’t perform that action at this time.
0 commit comments