atom/atom-keymap

Partial key mapping can get wrongly resolved

Closed this issue · 1 comments

I don't understand the specifics of the keymap manager enough to directly point at the issue, but it has to do with partial key mappings and overrides. It looks like in some circumstances, the wrong binding can be resolved either as the timeout or when hitting multiple keys.

To reproduce, add the following two (random) commands to your keymap:

'body':
  'ctrl-tab': 'status-bar:toggle'
  'ctrl-tab ^ctrl': 'editor:log-cursor-scope'

Now, hold down Ctrl and press Tab once, keeping Ctrl held. After a second, your tab will switch to your recent tab. If you have the key binding resolver visible, you can see that the native mapping to pane:show-next-recently-used-item gets called. Releasing Ctrl at this point doesn't cause the log, but I'm assuming that's because the key combination already timed-out.

Now, hold down Ctrl and press Tab twice. The second tab causes the status bar to toggle and the tab to switch to the next recent tab, somehow both key bindings get called. In this scenario the time-out never happens, and whenever you release Ctrl the log is shown as expected.

See additional discussion here.

This is a bug in the current keymap implementation and should be fixed in Atom 1.14 via #156. 1.14 will be released to beta channel in early January, but you could build from source if this is really blocking your workflow.