When using the panel jump keys and the target panel is already active, switch tabs

This commit is contained in:
Stefan Haller
2024-08-03 15:55:28 +02:00
parent c72be6cbf3
commit b37d6dcd1c
4 changed files with 44 additions and 2 deletions

View File

@@ -338,6 +338,7 @@ var tests = []*components.IntegrationTest{
ui.OpenLinkFailure,
ui.RangeSelect,
ui.SwitchTabFromMenu,
ui.SwitchTabWithPanelJumpKeys,
undo.UndoCheckoutAndDrop,
undo.UndoDrop,
worktree.AddFromBranch,

View File

@@ -0,0 +1,34 @@
package ui
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var SwitchTabWithPanelJumpKeys = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Switch tab with the panel jump keys",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Worktrees().Focus().
Press(keys.Universal.JumpToBlock[2])
t.Views().Branches().IsFocused().
Press(keys.Universal.JumpToBlock[2])
t.Views().Remotes().IsFocused().
Press(keys.Universal.JumpToBlock[2])
t.Views().Tags().IsFocused().
Press(keys.Universal.JumpToBlock[2])
t.Views().Branches().IsFocused().
Press(keys.Universal.JumpToBlock[1])
// When jumping to a panel from a different one, keep its current tab:
t.Views().Worktrees().IsFocused()
},
})