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.

Do not spawn oneshot tasks from blank prompts (#10115)

Kirill Bulatov027897e003c6
diff --git a/crates/tasks_ui/src/modal.rs b/crates/tasks_ui/src/modal.rs
index 6499b408887..7964362f1ba 100644
--- a/crates/tasks_ui/src/modal.rs
+++ b/crates/tasks_ui/src/modal.rs
@@ -75,6 +75,10 @@ impl TasksModalDelegate {
}
fn spawn_oneshot(&mut self, cx: &mut AppContext) -> Option<Arc<dyn Task>> {
+ if self.prompt.trim().is_empty() {
+ return None;
+ }
+
self.inventory
.update(cx, |inventory, _| inventory.source::<OneshotSource>())?
.update(cx, |oneshot_source, _| {
@@ -373,6 +377,7 @@ impl PickerDelegate for TasksModalDelegate {
}
Some(spawn_prompt.command)
}
+
fn confirm_input(&mut self, omit_history_entry: bool, cx: &mut ViewContext<Picker<Self>>) {
let Some(task) = self.spawn_oneshot(cx) else {
return;