Favor the most recent matching binding when selecting app menu shortcuts

We sending every binding matching the `body` selector to the browser
process, but it only selects the first. Since we scan the bindings in
chronological order, we need to unshift bindings to the front of the
array so the most recently defined bindings are loaded first.
This commit is contained in:
Nathan Sobo
2014-03-21 10:33:22 -06:00
parent 0f50c40a93
commit 61e9befbe7

View File

@@ -77,7 +77,7 @@ class MenuManager
keystrokesByCommand = {}
for binding in atom.keymap.getKeyBindings() when @includeSelector(binding.selector)
keystrokesByCommand[binding.command] ?= []
keystrokesByCommand[binding.command].push binding.keystroke
keystrokesByCommand[binding.command].unshift binding.keystroke
@sendToBrowserProcess(@template, keystrokesByCommand)
loadPlatformItems: ->