atom / atom-keymap

Atom's selector-based keymap system
MIT License
105 stars 58 forks source link

Cannot unset! core ctrl-tab and ctrl-shift-tab behavior #133

Closed JamieREvans closed 8 years ago

JamieREvans commented 8 years ago

I'm trying to change the behavior of ctrl-[shift-]tab in my editor, but I can't seem to disable the core behavior.

Here is what's in my keymap.cson:

'body':
  'ctrl-tab': 'unset!'
  'ctrl-shift-tab': 'unset!'

'body':
  'ctrl-tab': 'pane:show-next-item'
  'ctrl-shift-tab': 'pane:show-previous-item'

However, both commands are still run when I press ctrl-[shift-]tab. The keybinding resolver also indicates that both are active, but the core behavior is green (both have checkmarks, though).

winstliu commented 8 years ago

You have two problems here:

  1. CSON can't have duplicate keys (it overrides each duplicate with the last key it finds), so you should group the latter body under the first one. You can learn more about CSON here.
  2. The MRU keybindings are actually different than the ones you're trying to unset: you'll need to unset ctrl-tab ^ctrl instead. Sorry for the confusion about this - it appears that the Settings View and Keybinding Resolver don't display the ^ctrl properly yet.

I hope this solved your question - if not, please create a new topic on Discuss. Thanks!

JamieREvans commented 8 years ago

Thanks for your reply! However, that's what I originally had, as well. Based on what you said, this should work:

'body':
  'ctrl-tab': 'unset!'
  'ctrl-shift-tab': 'unset!'
  'ctrl-tab ^ctrl': 'unset!'
  'ctrl-shift-tab ^ctrl': 'unset!'
  'ctrl-tab': 'pane:show-next-item'
  'ctrl-shift-tab': 'pane:show-previous-item'

Although, it doesn't, either.

winstliu commented 8 years ago

Can you try the keymap suggested in this comment?