Add more context to the save new file path picker (#19863)
Release Notes: - N/A Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
a3f0bb4547
commit
85ff03cde0
4 changed files with 52 additions and 6 deletions
|
@ -108,7 +108,11 @@ pub trait PickerDelegate: Sized + 'static {
|
|||
fn should_dismiss(&self) -> bool {
|
||||
true
|
||||
}
|
||||
fn confirm_completion(&self, _query: String) -> Option<String> {
|
||||
fn confirm_completion(
|
||||
&mut self,
|
||||
_query: String,
|
||||
_: &mut ViewContext<Picker<Self>>,
|
||||
) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -370,7 +374,7 @@ impl<D: PickerDelegate> Picker<D> {
|
|||
}
|
||||
|
||||
fn confirm_completion(&mut self, _: &ConfirmCompletion, cx: &mut ViewContext<Self>) {
|
||||
if let Some(new_query) = self.delegate.confirm_completion(self.query(cx)) {
|
||||
if let Some(new_query) = self.delegate.confirm_completion(self.query(cx), cx) {
|
||||
self.set_query(new_query, cx);
|
||||
} else {
|
||||
cx.propagate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue