mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Validate that Universal.JumpToBlock array has 5 elements
The code that uses this panics if it has fewer.
This commit is contained in:
parent
f3791e6ab6
commit
a5f78d3222
2 changed files with 24 additions and 1 deletions
|
@ -68,5 +68,14 @@ func validateKeybindingsRecurse(path string, node any) error {
|
|||
}
|
||||
|
||||
func validateKeybindings(keybindingConfig KeybindingConfig) error {
|
||||
return validateKeybindingsRecurse("", keybindingConfig)
|
||||
if err := validateKeybindingsRecurse("", keybindingConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(keybindingConfig.Universal.JumpToBlock) != 5 {
|
||||
return fmt.Errorf("keybinding.universal.jumpToBlock must have 5 elements; found %d.",
|
||||
len(keybindingConfig.Universal.JumpToBlock))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue