Closed
Description
We have a yaml fork which specially handles null values when merging yaml files. This allows us to set a keybinding to null and have it unmapped, rather than being set to the default.
I want to migrate users' configs to instead use <disabled>
in place of null
so that we get the same merging behaviour without needing to use my fork.
We can test the behaviour with this integration test:
// pkg/integration/tests/misc/null_keybinding.go
package misc
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var NullKeybinding = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Confirms You can set keybindings to blank to disable them",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Keybinding.Universal.ScrollRight = "<disabled>"
config.UserConfig.Keybinding.Universal.NextTab = "H"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Press("H")
// NOTE: by the time we add this test, we might have inserted a 'worktrees' tab between the files and submodules tab, in which case we'll need to verify here that the worktrees view is focused
t.Views().Submodules().IsFocused()
},
})