Fix Nil map error

This commit is contained in:
lordwelch 2020-03-05 14:46:17 -08:00
parent 7441c3e637
commit c2f2d16097

View File

@ -273,6 +273,9 @@ func (k *Keyboard) CurrentKeymap() Keymap {
if ok {
return keymap
}
if k.keymaps == nil {
k.keymaps = make(map[string]Keymap)
}
k.keymaps[k.KeymapOrder[k.currentKeyMap]] = LoadKeymap(k.KeymapOrder[k.currentKeyMap], k.KeymapPath)
return k.keymaps[k.KeymapOrder[k.currentKeyMap]]
}