Disallow duplicate keys when loading package keymaps

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Max Brunsfeld
2016-09-22 14:21:36 -07:00
committed by Nathan Sobo
parent 59189dc0d5
commit db781dd54f
2 changed files with 2 additions and 2 deletions

View File

@@ -52,7 +52,7 @@
"scandal": "^2.2.1",
"scoped-property-store": "^0.17.0",
"scrollbar-style": "^3.2",
"season": "^5.3",
"season": "^5.4",
"semver": "^4.3.3",
"service-hub": "^0.7.2",
"sinon": "1.17.4",

View File

@@ -251,7 +251,7 @@ class Package
if @bundledPackage and @packageManager.packagesCache[@name]?
@keymaps = (["#{@packageManager.resourcePath}#{path.sep}#{keymapPath}", keymapObject] for keymapPath, keymapObject of @packageManager.packagesCache[@name].keymaps)
else
@keymaps = @getKeymapPaths().map (keymapPath) -> [keymapPath, CSON.readFileSync(keymapPath) ? {}]
@keymaps = @getKeymapPaths().map (keymapPath) -> [keymapPath, CSON.readFileSync(keymapPath, allowDuplicateKeys: false) ? {}]
return
loadMenus: ->