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

Pane Switching Keymaps not working as set #777

Closed
JSn1nj4 opened this issue Apr 26, 2016 · 6 comments
Closed

Pane Switching Keymaps not working as set #777

JSn1nj4 opened this issue Apr 26, 2016 · 6 comments
Labels

Comments

@JSn1nj4
Copy link

JSn1nj4 commented Apr 26, 2016

I know this may be considered a "Duplicate" by some, but it's an issue that's still going on. I'm on Windows 10 using Atom 1.7.2. Unsetting a keybinding using unset! is the only kind of "override" I'm able to do.

Here's what I'm trying to do:

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

At first I tried using atom-workspace, since I saw that in the keymaps.cson comments. Then I tried using body, since that appeared to be the selector I had to use, as shown in this screenshot:
failed-keybindings-settings

I followed the suggestions I saw in issue #124 for using the selectors .workspace, .workspace .editor:not(.mini), or .workspace and .workspace .editor:not(.mini) separately, even though using body to unset! keymaps works, as shown in this screenshot:
failed-keybindings-keymap_file

Unsetting the old keybindings for switching between next/previous works, but not overriding the keybindings that switch between recent tabs.

One other thing I tried was using the "copy" button to the left of the keybindings I wanted to override, in the first screenshot. Changing the copied code didn't work either. Neither the keymapping segments of the code nor the selector (body) worked any better.

Additional information:

  • It also happens in Safe Mode
  • Found similar issues that were assumed to be an issue with not using the correct selectors, but shouldn't one override the other if it uses the exact same CSS selector?

If this belongs in the core repository, I'll move it there. Didn't realize there were several repositories.

@JSn1nj4
Copy link
Author

JSn1nj4 commented Apr 26, 2016

After further testing, not even unset! works on the above keymaps when using workspace, .workspace, atom-workspace, or .atom-workspace. Only with body.

@JSn1nj4
Copy link
Author

JSn1nj4 commented Apr 26, 2016

Small update: when I try switching slowly, it's as if it's trying to follow the new keybinding. It uses the new action initially, but then the default action happens right after.

@JSn1nj4
Copy link
Author

JSn1nj4 commented Apr 27, 2016

Important update: found a workaround. Had to use the keybinding resolver to figure out what was going on. When using ctrl-tab or ctrl-shift-tab, there were extra keybindings that worked alongside the default behavior for these 2: ctrl-tab ^ctrl and ctrl-shift-tab ^ctrl, respectively. These last 2 keybindings alter the "recently used items" stack.

To disable the default behavior of switching between recent tabs and instead cycle linearly, this is how I had to set my keymaps.cson file:

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

Assuming the 2 extra keybindings are needed for the default behavior, I'll also assume that this isn't actually a bug. But if reordering the stack of open views (documents, settings, config files etc.) is necessary only for the default ctrl-tab/ctrl-shift-tab behaviors, I would recommend not having this behavior as a separate keybinding. Assuming it's meant to work in tandem only with those 2 default keybindings, having those 2 extra default keybindings feels more like a workaround than an actual solution to the problem.

@lee-dohm
Copy link
Contributor

As you suspected, this is the intended behavior. The extra ^ctrl in the keybinding instructs those keybindings to not activate until Ctrl is released. We documented the method of restoring the original behavior in the blog post announcing the change here:

http://blog.atom.io/2016/04/12/atom-1-7-and-1-8-beta.html#most-recently-used-tab-switching

We're discussing ways to communicate these kinds of changes better in the future.

@JSn1nj4
Copy link
Author

JSn1nj4 commented Apr 27, 2016

Appreciate it. Thanks.

@lee-dohm
Copy link
Contributor

You're welcome, thanks for understanding!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants