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

Shortcut LVL can discart lower level too brutally #451

@Goaman

Description

@Goaman

If you have a shortcut that match with the keymap in a specific LVL (e.g. USER (LVL1)), it stop rerturning the match for a previous LVL (e.g. DEFAULT (LVL0)).

Because of the following logic in Keymap.ts:

if (matchingCommands.length) {
    // Matches were found at this level so do not look lower.
    break;
}

This mechanism was put in place for being able to override a shortcut in a LVL higher previous lvl that could match with the shortcut.

However, if we create a selector that match anything in the user LVL2:

A user defining a shortcut:

{
  pattern: 'TAB',
  selector: [() => true],
  commandId: 'openLinkDialog',
}

Any shortuct TAB in user space will be discarted.

Thus making the tab shortcut for list not working.

We need to rethink to not discart the all the shortcut of a lower level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionExtra discussion is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions