Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmd+number does not open expected window #99

Closed
jsardev opened this issue Dec 18, 2017 · 4 comments
Closed

Cmd+number does not open expected window #99

jsardev opened this issue Dec 18, 2017 · 4 comments
Assignees

Comments

@jsardev
Copy link

jsardev commented Dec 18, 2017

So let me give an example:

  1. I'm in Source Control window
  2. I click CMD+1 to open explorer
  3. The window hides (?)
  4. I click CMD+1 again to open explorer
  5. The window shows but still in Source Control option

All of this works the same for all the window shortcuts (cmd+number), except Search shortcut (cmd+3) - this one works as expected (switches always to Search window).

Any ideas? Is my configuration messed up, or is it just a bug? :)

@kasecato kasecato self-assigned this Dec 19, 2017
@xc1427
Copy link

xc1427 commented Jan 15, 2018

To repair this, the following keybinding works, which however is not perfect,

    {
        "key": "cmd+1",
        "command": "workbench.action.toggleSidebarVisibility",
        "when": "explorerViewletVisible"
    },
    {
        "key": "cmd+1",
        "command": "workbench.view.explorer",
        "when": "!explorerViewletFocus"
    },

@kasecato As I see, the original keybinding relies on "when": "editorFocus", which is not consistent(the explorer sidebar is in focus after toggle only when a folder is opened. Maybe this can be seen as an VSCode bug (I filed un issue microsoft/vscode#41624 )). This behavios exists in other CMD + NUM keybindings as well except for Search window.

@jsardev
Copy link
Author

jsardev commented Jan 16, 2018

I've fixed it for myself for now just by attaching numbers (1, 2, 3, 4, 5) to corresponding views (explorer, search, scm, debug, extensions).

    {
        "key": "cmd+1",
        "command": "workbench.view.explorer"
    },
    {
        "key": "cmd+2",
        "command": "workbench.view.search"
    },
    {
        "key": "cmd+3",
        "command": "workbench.view.scm"
    },
    {
        "key": "cmd+4",
        "command": "workbench.view.debug"
    },
    {
        "key": "cmd+5",
        "command": "workbench.view.extensions"
    }

This may not be mapping to IntelliJ shortcuts but fixes my problem for now. I'm closing the sidebar if wanted with default "close window" key from IntelliJ - shift+esc. I guess that the perfect behaviour cannot be added until the macro keybindings feature in VSCode will be there (microsoft/vscode#871).

@xc1427
Copy link

xc1427 commented Jan 16, 2018

You can try VSCode version 1.20.0 insider. As a related issue (microsoft/vscode#41377) is fixed in this version, I think the regression within the Cmd+Number key binding disappears.

@kasecato
Copy link
Owner

Fixed by vscode-side

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

No branches or pull requests

3 participants