From 027897e003c66757bbf34893dd92e4eacad07c0a Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 3 Apr 2024 13:54:16 +0200 Subject: [PATCH] Do not spawn oneshot tasks from blank prompts (#10115) --- crates/tasks_ui/src/modal.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tasks_ui/src/modal.rs b/crates/tasks_ui/src/modal.rs index 6499b40888..7964362f1b 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> { + if self.prompt.trim().is_empty() { + return None; + } + self.inventory .update(cx, |inventory, _| inventory.source::())? .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>) { let Some(task) = self.spawn_oneshot(cx) else { return;