workspace: Add workspace::FocusCenterPane#46059
Merged
Veykril merged 1 commit intozed-industries:mainfrom Mar 18, 2026
Merged
Conversation
|
Hi, this seems like a very nice feature. What's left to do here? |
Contributor
Author
|
hey @maxdeviant let me know if there is anything to do for this one. |
Veykril
reviewed
Mar 17, 2026
| if let Some(item) = self.active_item(cx) { | ||
| item.item_focus_handle(cx).focus(window, cx); | ||
| } else { | ||
| log::error!("Could not find a focus target when switching focus to the center panes",); |
Member
There was a problem hiding this comment.
This log doesn't really serve any purpose I think, let's remove it
Contributor
Author
There was a problem hiding this comment.
@Veykril
happy to remove this, i just wanted to double check first though.
I copied this structure from activate_pane_in_direction().
zed/crates/workspace/src/workspace.rs
Line 4556 in 5920e22
Just trying to follow what was already in the codebase, let me know if you would still like me to take it out!
7c69bb5 to
e0c6628
Compare
Contributor
Author
|
rebased. |
AmaanBilwar
pushed a commit
to AmaanBilwar/zed
that referenced
this pull request
Mar 20, 2026
solution for zed-industries#43004 Release Notes: - Added workspace::FocusCenterPane The `editor::ToggleFocus` action not working really drives me bonkers, and it also doesn't really make sense, because it doesn't toggle anything. it moves focus, but doesn't move focus back anywhere if you run it again so 'ToggleFocus' seems misleading. Here we have added an action that just moves focus to the most recent center pane: `workspace::FocusCenterPane` this action correctly moves the focus to the center pane from any dock, even if the center pane is the project diff, branch diff, terminal, or keymap editor, etc. i'm not sure if this would be considered a 'replacement' for `editor::ToggleFocus` but i do think this is probably more in line with what most users would consider the expected behavior.
AmaanBilwar
pushed a commit
to AmaanBilwar/zed
that referenced
this pull request
Mar 23, 2026
solution for zed-industries#43004 Release Notes: - Added workspace::FocusCenterPane The `editor::ToggleFocus` action not working really drives me bonkers, and it also doesn't really make sense, because it doesn't toggle anything. it moves focus, but doesn't move focus back anywhere if you run it again so 'ToggleFocus' seems misleading. Here we have added an action that just moves focus to the most recent center pane: `workspace::FocusCenterPane` this action correctly moves the focus to the center pane from any dock, even if the center pane is the project diff, branch diff, terminal, or keymap editor, etc. i'm not sure if this would be considered a 'replacement' for `editor::ToggleFocus` but i do think this is probably more in line with what most users would consider the expected behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solution for #43004
Release Notes:
The
editor::ToggleFocusaction not working really drives me bonkers, and it also doesn't really make sense, because it doesn't toggle anything. it moves focus, but doesn't move focus back anywhere if you run it again so 'ToggleFocus' seems misleading.Here we have added an action that just moves focus to the most recent center pane:
workspace::FocusCenterPanethis action correctly moves the focus to the center pane from any dock, even if the center pane is the project diff, branch diff, terminal, or keymap editor, etc.
i'm not sure if this would be considered a 'replacement' for
editor::ToggleFocusbut i do think this is probably more in line with what most users would consider the expected behavior.