tasks: change placeholder text in a modal (#10166)
Related to: #10132 Release Notes: - N/A
This commit is contained in:
parent
7d1a5d2ddf
commit
1c485a0d05
3 changed files with 4 additions and 9 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -9500,7 +9500,6 @@ dependencies = [
|
||||||
"gpui",
|
"gpui",
|
||||||
"itertools 0.11.0",
|
"itertools 0.11.0",
|
||||||
"language",
|
"language",
|
||||||
"menu",
|
|
||||||
"picker",
|
"picker",
|
||||||
"project",
|
"project",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -13,7 +13,6 @@ anyhow.workspace = true
|
||||||
editor.workspace = true
|
editor.workspace = true
|
||||||
fuzzy.workspace = true
|
fuzzy.workspace = true
|
||||||
gpui.workspace = true
|
gpui.workspace = true
|
||||||
menu.workspace = true
|
|
||||||
picker.workspace = true
|
picker.workspace = true
|
||||||
project.workspace = true
|
project.workspace = true
|
||||||
task.workspace = true
|
task.workspace = true
|
||||||
|
|
|
@ -55,6 +55,7 @@ pub(crate) struct TasksModalDelegate {
|
||||||
workspace: WeakView<Workspace>,
|
workspace: WeakView<Workspace>,
|
||||||
prompt: String,
|
prompt: String,
|
||||||
task_context: TaskContext,
|
task_context: TaskContext,
|
||||||
|
placeholder_text: Arc<str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TasksModalDelegate {
|
impl TasksModalDelegate {
|
||||||
|
@ -71,6 +72,7 @@ impl TasksModalDelegate {
|
||||||
selected_index: 0,
|
selected_index: 0,
|
||||||
prompt: String::default(),
|
prompt: String::default(),
|
||||||
task_context,
|
task_context,
|
||||||
|
placeholder_text: Arc::from("Run a task..."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,13 +199,8 @@ impl PickerDelegate for TasksModalDelegate {
|
||||||
self.selected_index = ix;
|
self.selected_index = ix;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn placeholder_text(&self, cx: &mut WindowContext) -> Arc<str> {
|
fn placeholder_text(&self, _: &mut WindowContext) -> Arc<str> {
|
||||||
Arc::from(format!(
|
self.placeholder_text.clone()
|
||||||
"{} 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 update_matches(
|
fn update_matches(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue