Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Bundled prefixed keys bindings delay even if 'unset!' by user keymap #78

Closed

Description

@peterwmwong

This affects keybindings like cmd-k, where cmd-k is the prefix of many keybindings that come bundled with Atom. Hitting cmd-k has a delay even if every single one of these keybindings are unset! in the user key map.

Doing some debugging, in the dev tools. What appears to be happening is this...

Putting a breakpoint on line 440 of keymap-manager.js (where partial matches are found)...
screen shot 2015-04-21 at 9 30 58 pm
... and hitting cmd-k to hit our breakpoint, we see that the partialMatchCandidates array being filtered will iterate over the bundled keymap bindings BEFORE the user bindings. The console in the screenshot above, shows the source of all the keybindings of partialMatchCandidates. As you can all the bindings from /Application/Atom.app/* are at the top, while the user bindings from /Users/* are on the bottom. This ordering allows line 444 of keymap-manager.js to be reached, which incorrectly identifies it as a partialMatch even though a user specified keymap binding has it unset!.

A naive fix that simply reverses the order of partialMatchCandidates (process bundled bindings AFTER user bindings)...
screen shot 2015-04-21 at 9 39 43 pm
...correctly yields an empty partialMatches as all user bindings are added to the ignoreKeystrokes set and all the bundled key bindings are then ignored.

@stmichael mentioned this behavior on a different issue #49

Activity

  1. peterwmwong commented on Apr 22, 2015

    @peterwmwong
    Author

    Simply flipping the order is probably not the correct fix. Maybe first adding all the unset! bindings to the ignoreKeystrokes set, before filtering?

  2. ilyashubin commented on Jun 30, 2015

    @ilyashubin

    +1. Would be nice to have a way to remove this delay somehow

  3. meleyal commented on Jul 2, 2015

    @meleyal

    +1

  4. birbird commented on Jul 20, 2015

    @birbird

    +1

  5. added a commit that references this issue on Jul 25, 2015
    71414f7
  6. added a commit that references this issue on Jul 27, 2015
    cde55b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions