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

Commit d964cf8

Browse files
Changed check
1 parent bb5c613 commit d964cf8

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/command/KeyBindingManager.js

Lines changed: 9 additions & 4 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
/**
@@ -397,9 +397,14 @@ define(function (require, exports, module) {
397397

398398
// skip if the key is already assigned
399399
if (existing) {
400-
// do not re-assign a key binding
401-
console.error("Cannot assign " + normalized + " to " + commandID + ". It is already assigned to " + _keyMap[normalized].commandID);
402-
return null;
400+
if (!existing.explicitPlatform && explicitPlatform) {
401+
// remove the the generic binding to replace with this new platform-specific binding
402+
removeBinding(normalized);
403+
} else {
404+
// do not re-assign a key binding
405+
console.error("Cannot assign " + normalized + " to " + commandID + ". It is already assigned to " + _keyMap[normalized].commandID);
406+
return null;
407+
}
403408
}
404409

405410
// delete existing bindings when

0 commit comments

Comments
 (0)