Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit ecc0583

Browse files
committed
Merge pull request #3081 from WebsiteDeveloper/Issue-3032
Fixed: #3032 KeyBindingManager no longer warns / prevents binding collisions
2 parents 87bd72f + d964cf8 commit ecc0583

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/command/KeyBindingManager.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424

25-
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true, boss: true */
25+
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true */
2626
/*global define, $, brackets, window */
2727

2828
/**
@@ -395,16 +395,14 @@ define(function (require, exports, module) {
395395
return null;
396396
}
397397

398-
// skip if the key is already assigned explicitly for this platform
398+
// skip if the key is already assigned
399399
if (existing) {
400-
if (!existing.explicitPlatform) {
401-
// remove existing generic bindings, then re-map this binding
402-
// to the new command
400+
if (!existing.explicitPlatform && explicitPlatform) {
401+
// remove the the generic binding to replace with this new platform-specific binding
403402
removeBinding(normalized);
404403
} else {
405-
// do not re-assign a platform-specific key binding
406-
console.log("Cannot assign " + normalized + " to " + commandID +
407-
". It is already assigned to " + _keyMap[normalized].commandID);
404+
// do not re-assign a key binding
405+
console.error("Cannot assign " + normalized + " to " + commandID + ". It is already assigned to " + _keyMap[normalized].commandID);
408406
return null;
409407
}
410408
}

0 commit comments

Comments
 (0)