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.

inline assistant: Do not dismiss while generating when hitting enter (#32810)

Bennet Bo Fenner6e04b9ef6586
diff --git a/crates/agent/src/inline_assistant.rs b/crates/agent/src/inline_assistant.rs
index 28841e21ad2..6b7ebb061ab 100644
--- a/crates/agent/src/inline_assistant.rs
+++ b/crates/agent/src/inline_assistant.rs
@@ -765,9 +765,6 @@ impl InlineAssistant {
PromptEditorEvent::CancelRequested => {
self.finish_assist(assist_id, true, window, cx);
}
- PromptEditorEvent::DismissRequested => {
- self.dismiss_assist(assist_id, window, cx);
- }
PromptEditorEvent::Resized { .. } => {
// This only matters for the terminal inline assistant
}
diff --git a/crates/agent/src/inline_prompt_editor.rs b/crates/agent/src/inline_prompt_editor.rs
index e9d1f46b17d..31b0c795956 100644
--- a/crates/agent/src/inline_prompt_editor.rs
+++ b/crates/agent/src/inline_prompt_editor.rs
@@ -403,9 +403,7 @@ impl<T: 'static> PromptEditor<T> {
CodegenStatus::Idle => {
cx.emit(PromptEditorEvent::StartRequested);
}
- CodegenStatus::Pending => {
- cx.emit(PromptEditorEvent::DismissRequested);
- }
+ CodegenStatus::Pending => {}
CodegenStatus::Done => {
if self.edited_since_done {
cx.emit(PromptEditorEvent::StartRequested);
@@ -831,7 +829,6 @@ pub enum PromptEditorEvent {
StopRequested,
ConfirmRequested { execute: bool },
CancelRequested,
- DismissRequested,
Resized { height_in_lines: u8 },
}
diff --git a/crates/agent/src/terminal_inline_assistant.rs b/crates/agent/src/terminal_inline_assistant.rs
index 4e907f04ce2..993cfd2fbdb 100644
--- a/crates/agent/src/terminal_inline_assistant.rs
+++ b/crates/agent/src/terminal_inline_assistant.rs
@@ -167,9 +167,6 @@ impl TerminalInlineAssistant {
PromptEditorEvent::CancelRequested => {
self.finish_assist(assist_id, true, false, window, cx);
}
- PromptEditorEvent::DismissRequested => {
- self.dismiss_assist(assist_id, window, cx);
- }
PromptEditorEvent::Resized { height_in_lines } => {
self.insert_prompt_editor_into_terminal(assist_id, *height_in_lines, window, cx);
}