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.

assistant: Fix inline assist not restarting transformation after pressing retry (#17301)

Bennet Bo Fenner32db140b9545
diff --git a/crates/assistant/src/inline_assistant.rs b/crates/assistant/src/inline_assistant.rs
index 871cc5b0250..63c8e45bfdd 100644
--- a/crates/assistant/src/inline_assistant.rs
+++ b/crates/assistant/src/inline_assistant.rs
@@ -1794,13 +1794,16 @@ impl PromptEditor {
CodegenStatus::Pending => {
cx.emit(PromptEditorEvent::DismissRequested);
}
- CodegenStatus::Done | CodegenStatus::Error(_) => {
+ CodegenStatus::Done => {
if self.edited_since_done {
cx.emit(PromptEditorEvent::StartRequested);
} else {
cx.emit(PromptEditorEvent::ConfirmRequested);
}
}
+ CodegenStatus::Error(_) => {
+ cx.emit(PromptEditorEvent::StartRequested);
+ }
}
}
diff --git a/crates/assistant/src/terminal_inline_assistant.rs b/crates/assistant/src/terminal_inline_assistant.rs
index 426d565cc1f..17501959821 100644
--- a/crates/assistant/src/terminal_inline_assistant.rs
+++ b/crates/assistant/src/terminal_inline_assistant.rs
@@ -805,13 +805,16 @@ impl PromptEditor {
CodegenStatus::Pending => {
cx.emit(PromptEditorEvent::DismissRequested);
}
- CodegenStatus::Done | CodegenStatus::Error(_) => {
+ CodegenStatus::Done => {
if self.edited_since_done {
cx.emit(PromptEditorEvent::StartRequested);
} else {
cx.emit(PromptEditorEvent::ConfirmRequested);
}
}
+ CodegenStatus::Error(_) => {
+ cx.emit(PromptEditorEvent::StartRequested);
+ }
}
}