mirror of
https://github.com/vsariola/sointu.git
synced 2025-11-12 12:52:53 -05:00
refactor: use yaml.v3 everywhere and remove dependency on yaml.v2
This commit is contained in:
parent
f4bb2bc754
commit
8e99c93d14
@ -1,6 +1,7 @@
|
||||
package gioui
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"strconv"
|
||||
@ -10,7 +11,7 @@ import (
|
||||
"gioui.org/io/event"
|
||||
"gioui.org/io/key"
|
||||
"github.com/vsariola/sointu/tracker"
|
||||
"gopkg.in/yaml.v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -31,7 +32,9 @@ var defaultKeyBindings []byte
|
||||
|
||||
func init() {
|
||||
var keyBindings, userKeybindings []KeyBinding
|
||||
if err := yaml.UnmarshalStrict(defaultKeyBindings, &keyBindings); err != nil {
|
||||
dec := yaml.NewDecoder(bytes.NewReader(defaultKeyBindings))
|
||||
dec.KnownFields(true)
|
||||
if err := dec.Decode(&keyBindings); err != nil {
|
||||
panic(fmt.Errorf("failed to unmarshal default keybindings: %w", err))
|
||||
}
|
||||
if err := ReadCustomConfig("keybindings.yml", &userKeybindings); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user