Skip to content

Add sidebarFocus, panelFocus, a real editorFocus and focus for each view #59858

@octref

Description

@octref

Related: #44796 (comment)

I opened #59270 to add 4 commands:

  • workbench.action.previousPanelView
  • workbench.action.previousSidebarView
  • workbench.action.nextPanelView
  • workbench.action.nextSidebarView

The way I want it to work:

Ctrl-[:

  • workbench.action.previousPanelView when panelFocus
  • workbench.action.previousSidebarView when sidebarFocus
  • workbench.action.previousEditor when editorFocus

Ctrl-]:

  • workbench.action.nextPanelView when panelFocus
  • workbench.action.nextSidebarView when sidebarFocus
  • workbench.action.nextEditor when editorFocus

They are impossible because of many keybinding issues:

  • We only have filesExplorerFocus for sidebar views. It's not even explorerFocus, meaning that focusing on Open Editors or Outlines doesn't work
  • We only have terminalFocus for panel views.
  • editorFocus applies to the input box in search view, input in debug console, etc. There is no context key for editorFocus
  • activeViewlet and activePanel do not help. For example, if I have both sidebar and panel open, activeViewlet always wins in the following setting, even if I'm focused on terminal.
[
    {
        "key": "cmd+]",
        "command": "workbench.action.nextEditor"
    },
    {
        "key": "cmd+[",
        "command": "workbench.action.previousEditor"
    },
    { "key": "cmd+]", "command": "workbench.action.nextSidebarView", "when": "activeViewlet == workbench.view.explorer" },
    { "key": "cmd+]", "command": "workbench.action.nextSidebarView", "when": "activeViewlet == workbench.view.search" },
    { "key": "cmd+]", "command": "workbench.action.nextSidebarView", "when": "activeViewlet == workbench.view.scm" },
    { "key": "cmd+]", "command": "workbench.action.nextSidebarView", "when": "activeViewlet == workbench.view.debug" },
    { "key": "cmd+]", "command": "workbench.action.nextSidebarView", "when": "activeViewlet == workbench.view.extensions" },
    { "key": "cmd+[", "command": "workbench.action.previousSidebarView", "when": "activeViewlet == workbench.view.explorer" },
    { "key": "cmd+[", "command": "workbench.action.previousSidebarView", "when": "activeViewlet == workbench.view.search" },
    { "key": "cmd+[", "command": "workbench.action.previousSidebarView", "when": "activeViewlet == workbench.view.scm" },
    { "key": "cmd+[", "command": "workbench.action.previousSidebarView", "when": "activeViewlet == workbench.view.debug" },
    { "key": "cmd+[", "command": "workbench.action.previousSidebarView", "when": "activeViewlet == workbench.view.extensions" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.panel.markers" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.panel.output" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.panel.repl" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.panel.terminal" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.panel.comments" },
    { "key": "cmd+]", "command": "workbench.action.nextPanelView", "when": "activePanel == workbench.view.search" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.panel.markers" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.panel.output" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.panel.repl" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.panel.terminal" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.panel.comments" },
    { "key": "cmd+[", "command": "workbench.action.previousPanelView", "when": "activePanel == workbench.view.search" }
]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions