Skip to content

Add an action listener to workspace for ActivatePreviousItem and ActivateNextItem#42588

Merged
ConradIrwin merged 1 commit intozed-industries:mainfrom
FloppyDisco:make-pane-activate-next-item-cycle-the-active-editor-when-focus-is-on-a-panel
Dec 2, 2025
Merged

Add an action listener to workspace for ActivatePreviousItem and ActivateNextItem#42588
ConradIrwin merged 1 commit intozed-industries:mainfrom
FloppyDisco:make-pane-activate-next-item-cycle-the-active-editor-when-focus-is-on-a-panel

Conversation

@FloppyDisco
Copy link
Contributor

Release Notes:

  • pane::ActivatePreviousItem and pane::ActivateNextItem now toggle the most recent pane when called from a dock panel

a couple months ago i posted a work around that used SendKeystrokes to
cycle through pane items when focused on a dock.
#35253

this pr would add this functionality to the these actions by default.
i implemented this by adding an action listener to the workspace level.


if the current context is a dock that does not hold a pane
it retrieves the most recent pane from activation_history and activates the next item on that pane instead.

  • "Pane > Editor"
    cycles through the current pane like normal
  • "Dock > Pane > Terminal"
    also cycles through the pane items like normal
  • "Dock > (Any Child that is not a child of Pane)"
    cycles through the items of the most recent pane.

this is the standard behavior in VS Code i believe.

in the video below you can see the actions cycling through the editor like normal when focus is on the editor.
then you can see the editor continue to cycle when the focus is on the project panel.
and that the focus stays on the project panel.
and you can see the action cycle the terminal items when the focus is moved to the terminal

activateNextItem.mov

the only thing i noticed is that for this to work the keybindings must be set above Pane
so they have to be set globally or on workspace. otherwise they do not match in the context

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 13, 2025
@maxdeviant maxdeviant changed the title add an action listener to workspace for ActivatePreviousItem and ActivateNextItem Add an action listener to workspace for ActivatePreviousItem and ActivateNextItem Nov 13, 2025
@ConradIrwin ConradIrwin merged commit f445f22 into zed-industries:main Dec 2, 2025
25 checks passed
@ConradIrwin
Copy link
Member

Thanks!

@katie-z-geer katie-z-geer moved this from Community PRs to Done in Quality Week – December 2025 Dec 2, 2025
someone13574 pushed a commit to someone13574/zed that referenced this pull request Dec 16, 2025
…vateNextItem (zed-industries#42588)

Release Notes:

- pane::ActivatePreviousItem and pane::ActivateNextItem now toggle the
most recent pane when called from a dock panel


a couple months ago i posted a work around that used `SendKeystrokes` to
cycle through pane items when focused on a dock.
zed-industries#35253

this pr would add this functionality to the these actions by default.
i implemented this by adding an action listener to the workspace level.

------
if the current context is a dock that does not hold a pane
it retrieves the most recent pane from `activation_history` and
activates the next item on that pane instead.

- `"Pane > Editor"`
cycles through the current pane like normal
- `"Dock > Pane > Terminal"`
also cycles through the pane items like normal
- `"Dock > (Any Child that is not a child of Pane)"`
cycles through the items of the most recent pane.

this is the standard behavior in VS Code i believe.

in the video below you can see the actions cycling through the editor
like normal when focus is on the editor.
then you can see the editor continue to cycle when the focus is on the
project panel.
and that the focus stays on the project panel.
and you can see the action cycle the terminal items when the focus is
moved to the terminal


https://github.com/user-attachments/assets/999ab740-d2fa-4d00-9e53-f7605217e6ac

the only thing i noticed is that for this to work the keybindings must
be set above `Pane`
so they have to be set globally or on workspace. otherwise they do not
match in the context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Development

Successfully merging this pull request may close these issues.

2 participants