adobe/brackets — pull request #5066 by redmunds (2013-09-05 02:40:29+00:00)
Title: Fix keybinding errant error message

This is for #4265. See [Peter Flynn's comment](https://github.com/adobe/brackets/issues/4265#issuecomment-23831957) for a good summary of the goal.

Logically, the code was already doing most of want (all except PeterF's last point). The problem was that keybinding being reported as an error was a generic (no platform specified) keybinding being temporarily inserted into the keybinding table (and would have correctly removed in a subsequent pass), but unfortunately conflicted with the keybinding of another command.

To fix this I changed 2 things:

1. Sort keybindings for command to insert platform-specific bindings first (which are never overridden), followed by the generic keybindings (which may be overridden). This prevents keybindings from being inserted which will later be removed. (Note might be able to cleanup some keybinding removal code here).

2. Delay declaring an error until command-specific keybindings are checked for overrides.

I also implemented **platform: "all"** as described in Peter's last point. Note that there are no cases in `keyboard.json` that require this, but it's required to fix a unit test.