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

Mac: KeyBindingManager displays errant error message #4265

Closed
@redmunds

Description

@redmunds

Recipe:

  1. Start Brackets with no extensions installed
  2. Look in console to see this error message
Cannot assign Cmd-G to navigate.gotoLine. It is already assigned to edit.findNext
command/KeyBindingManager.js:418

The shortcut keys are defined in src/base-config/keyboard.json as follows:

    "navigate.gotoLine":  [
        {
            "key": "Ctrl-G"
        },
        {
            "key": "Cmd-L",
            "platform": "mac"
        }
    ],

I guess that error message is to be expected since the all-platform shortcut is defined first. It would be nice if KeyBingingManager looked for an alternate mac shortcut definition before declaring an error.

Even worse, is if I change the order to put the mac-specific shortcut first as follows:

    "navigate.gotoLine":  [
        {
            "key": "Cmd-L",
            "platform": "mac"
        },
        {
            "key": "Ctrl-G"
        }
    ],

I still get the error.

Specifying specific shortcuts for both Mac and Win as follows gets rid of the error:

    "navigate.gotoLine":  [
        {
            "key": "Ctrl-G",
            "platform": "win"
        },
        {
            "key": "Cmd-L",
            "platform": "mac"
        }
    ],

But, this is undesirable because every new platform (e.g. "linux") will have to specifically add a shortcut.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions