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.

Remove agent_diff key context when agent review ends for an editor (#31930)

Cole Millerb14401f817e5
diff --git a/crates/agent/src/agent_diff.rs b/crates/agent/src/agent_diff.rs
index df491238456..c1c2ed87bb1 100644
--- a/crates/agent/src/agent_diff.rs
+++ b/crates/agent/src/agent_diff.rs
@@ -1464,7 +1464,10 @@ impl AgentDiff {
if !AgentSettings::get_global(cx).single_file_review {
for (editor, _) in self.reviewing_editors.drain() {
editor
- .update(cx, |editor, cx| editor.end_temporary_diff_override(cx))
+ .update(cx, |editor, cx| {
+ editor.end_temporary_diff_override(cx);
+ editor.unregister_addon::<EditorAgentDiffAddon>();
+ })
.ok();
}
return;
@@ -1560,7 +1563,10 @@ impl AgentDiff {
if in_workspace {
editor
- .update(cx, |editor, cx| editor.end_temporary_diff_override(cx))
+ .update(cx, |editor, cx| {
+ editor.end_temporary_diff_override(cx);
+ editor.unregister_addon::<EditorAgentDiffAddon>();
+ })
.ok();
self.reviewing_editors.remove(&editor);
}