-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix for Issue 4265: Mac: KeyBindingManager displays errant error message #4305
Conversation
@@ -554,6 +554,16 @@ define(function (require, exports, module) { | |||
var keyBinding; | |||
results = []; | |||
|
|||
keyBindings.sort(function (a, b) { | |||
if(a.platform === brackets.platform) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert space after if
@WebsiteDeveloper I tested this on mac and still saw the error. I believe it's because we still attempt to add all key bindings, not just the first one that matches. We might want to update
Initial review complete |
@jasonsanjose added it and it should fix the problem. |
@@ -554,13 +554,26 @@ define(function (require, exports, module) { | |||
var keyBinding; | |||
results = []; | |||
|
|||
keyBindings.forEach(function addSingleBinding(keyBindingRequest) { | |||
keyBindings.sort(function (a, b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing the wrong shortcuts appear on mac (e.g. F3 for find next). I tried fixing the sort function and this seems to work. I think you have your sort logic backwards:
keyBindings.sort(function (a, b) {
if (a.platform === brackets.platform) {
// "a" is platform specific and matches
return -1;
} else if (b.platform === brackets.platform) {
// "b" is platform specific and matches
return 1;
} else if (!a.platform && b.platform) {
// "a" is generic and "b" is not matching
return -1;
} else if (!b.platform && a.platform) {
// "b" is generic and "a" is not matching
return 1;
} else {
return 0;
}
});
Reviewed again. Back to @WebsiteDeveloper |
@jasonsanjose pushed the changes. |
@WebsiteDeveloper thanks for the reminder. I'll do that separately. Merging. |
Fix for Issue 4265: Mac: KeyBindingManager displays errant error message
@redmunds #4265