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:
Mikayla Maki 2024-10-28 17:21:41 -07:00 committed by GitHub
parent a3f0bb4547
commit 85ff03cde0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 52 additions and 6 deletions

View file

@ -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()