Skip to content

Provide command to focus most recently used editor group #11897

Closed

Description

@Tyriar

In order to create custom keybindings to toggle focus between the editor and something such as the terminal panel, a command to focus the active/most recently used editor group needs to be added. I believe this is the best that can be accomplished currently:

Focuses the first group, meaning if the second or third editor groups were focused this would feel wrong:

{ "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                            "when": "!terminalFocus" },
{ "key": "ctrl+`",          "command": "workbench.action.focusFirstEditorGroup",
                            "when": "terminalFocus" }

Or this which focused the most recently used editor group but opens the last editor/file in the group:

{ "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                            "when": "!terminalFocus" },
{ "key": "ctrl+`",          "command": "workbench.action.openLastEditorInGroup",
                            "when": "terminalFocus" }

Some context on request: #11714 (comment)

Activity

  1. added
    feature-request
    on Sep 12, 2016
  2. bpasero commented on Sep 12, 2016

    @bpasero
    Contributor

    Daniel Imms (@Tyriar) isn't that as easy as providing a global command that just puts focus into the active editor? E.g. IEditorService.getActiveEditor().focus()?

    PR welcome if you wanna give it a try.

  3. Tyriar commented on Sep 12, 2016

    @Tyriar
    ContributorAuthor

    Benjamin Pasero (@bpasero) yes, I expect it to be pretty easy.

  4. Tyriar commented on Sep 12, 2016

    @Tyriar
    ContributorAuthor

    Benjamin Pasero (@bpasero) got a better name than workbench.action.focusActiveEditorGroup?

  5. bpasero commented on Sep 12, 2016

    @bpasero
    Contributor

    Daniel Imms (@Tyriar) works for me 👍

  6. added a commit that references this issue on Sep 12, 2016
    7e58057
  7. locked and limited conversation to collaborators on Nov 18, 2017
  8. added a commit that references this issue on Sep 6, 2026
    251086f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions