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.

agent_ui: Fix editor not getting focused when adding selections (#48926)

Bennet Bo Fennerbf01a928e518
diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs
index 34bf7caa4db..94fbff72f78 100644
--- a/crates/agent_ui/src/acp/thread_view.rs
+++ b/crates/agent_ui/src/acp/thread_view.rs
@@ -2335,6 +2335,7 @@ impl AcpServerView {
active_thread.update(cx, |thread, cx| {
thread.message_editor.update(cx, |editor, cx| {
editor.insert_dragged_files(paths, added_worktrees, window, cx);
+ editor.focus_handle(cx).focus(window, cx);
})
});
}
@@ -2469,7 +2470,7 @@ impl Render for AcpServerView {
self.sync_queued_message_editors(window, cx);
v_flex()
- .track_focus(&self.focus_handle(cx))
+ .track_focus(&self.focus_handle)
.size_full()
.bg(cx.theme().colors().panel_background)
.child(match &self.server_state {
diff --git a/crates/agent_ui/src/acp/thread_view/active_thread.rs b/crates/agent_ui/src/acp/thread_view/active_thread.rs
index d8817bc2bf2..bde91fbec9a 100644
--- a/crates/agent_ui/src/acp/thread_view/active_thread.rs
+++ b/crates/agent_ui/src/acp/thread_view/active_thread.rs
@@ -7154,7 +7154,7 @@ impl Render for AcpThreadView {
v_flex()
.key_context("AcpThread")
- .track_focus(&self.focus_handle(cx))
+ .track_focus(&self.focus_handle)
.on_action(cx.listener(|this, _: &menu::Cancel, _, cx| {
if this.parent_id.is_none() {
this.cancel_generation(cx);