summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike JS. Choi <mkchoi212@icloud.com>2018-05-31 16:05:06 -0500
committerMike JS. Choi <mkchoi212@icloud.com>2018-05-31 16:05:06 -0500
commit02bd481bacc94546a2766f590024d9b61fbf7a3d (patch)
tree5bbdd09827190e8496e81c62449896c35db3c976
parent96ca3ec91ad55fd90436f1d32f6b6f18c7ef6a41 (diff)
Fix nil binding map bug
-rw-r--r--key/key.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/key/key.go b/key/key.go
index 169e44d..d1b1932 100644
--- a/key/key.go
+++ b/key/key.go
@@ -85,7 +85,9 @@ func LoadSettings() (b Binding, err error) {
// parseSettings looks for `$HOME/.fac.yml` and parses it into a `Binding` value
// If the file does not exist, it returns the `defaultBinding`
-func parseSettings() (b Binding) {
+func parseSettings() Binding {
+ b := make(Binding)
+
usr, err := currentUser()
if err != nil {
fmt.Println(color.Yellow(color.Regular, "fac: %s. Default key-bindings will be used", err.Error()))
@@ -105,7 +107,7 @@ func parseSettings() (b Binding) {
return defaultBinding
}
- return
+ return b
}
// consolidate takes the user's key-binding settings and fills the missings key-binds