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.

tasks: change placeholder text in a modal (#10166)

Piotr Osiewicz1c485a0d0580
diff --git a/Cargo.lock b/Cargo.lock
index bf7bea9f422..c67050dbea4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9500,7 +9500,6 @@ dependencies = [
"gpui",
"itertools 0.11.0",
"language",
- "menu",
"picker",
"project",
"serde",
diff --git a/crates/tasks_ui/Cargo.toml b/crates/tasks_ui/Cargo.toml
index a2dfd943403..b3d47f492d5 100644
--- a/crates/tasks_ui/Cargo.toml
+++ b/crates/tasks_ui/Cargo.toml
@@ -13,7 +13,6 @@ anyhow.workspace = true
editor.workspace = true
fuzzy.workspace = true
gpui.workspace = true
-menu.workspace = true
picker.workspace = true
project.workspace = true
task.workspace = true
diff --git a/crates/tasks_ui/src/modal.rs b/crates/tasks_ui/src/modal.rs
index fbb74c170a2..e8ecbbafe72 100644
--- a/crates/tasks_ui/src/modal.rs
+++ b/crates/tasks_ui/src/modal.rs
@@ -55,6 +55,7 @@ pub(crate) struct TasksModalDelegate {
workspace: WeakView<Workspace>,
prompt: String,
task_context: TaskContext,
+ placeholder_text: Arc<str>,
}
impl TasksModalDelegate {
@@ -71,6 +72,7 @@ impl TasksModalDelegate {
selected_index: 0,
prompt: String::default(),
task_context,
+ placeholder_text: Arc::from("Run a task..."),
}
}
@@ -197,13 +199,8 @@ impl PickerDelegate for TasksModalDelegate {
self.selected_index = ix;
}
- fn placeholder_text(&self, cx: &mut WindowContext) -> Arc<str> {
- Arc::from(format!(
- "{} use task name as prompt, {} spawns a bash-like task from the prompt, {} runs the selected task",
- cx.keystroke_text_for(&picker::UseSelectedQuery),
- cx.keystroke_text_for(&picker::ConfirmInput {secondary: false}),
- cx.keystroke_text_for(&menu::Confirm),
- ))
+ fn placeholder_text(&self, _: &mut WindowContext) -> Arc<str> {
+ self.placeholder_text.clone()
}
fn update_matches(