Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

workspace: Fix empty pane becomes unresponsive to keybindings after commit via terminal (#31905)

Smit Barmase2ebe16a52f9c
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index dd930e15e49..de63247f3b7 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -3502,7 +3502,14 @@ impl Workspace {
match target {
Some(ActivateInDirectionTarget::Pane(pane)) => {
- window.focus(&pane.focus_handle(cx));
+ let pane = pane.read(cx);
+ if let Some(item) = pane.active_item() {
+ item.item_focus_handle(cx).focus(window);
+ } else {
+ log::error!(
+ "Could not find a focus target when in switching focus in {direction} direction for a pane",
+ );
+ }
}
Some(ActivateInDirectionTarget::Dock(dock)) => {
// Defer this to avoid a panic when the dock's active panel is already on the stack.