mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 21:14:37 +03:00
linux: Set directory in SaveFileRequest dialog (#13850)
This has been bugging me for a while. If you create a new file and then save it, the dialogue would show the home directory and not the folder that you were in. This fixes it. Release Notes: - N/A
This commit is contained in:
parent
2a923e338f
commit
fc8749ffd7
@ -314,10 +314,14 @@ impl<P: LinuxClient + 'static> Platform for P {
|
||||
let directory = directory.to_owned();
|
||||
self.foreground_executor()
|
||||
.spawn(async move {
|
||||
let result = SaveFileRequest::default()
|
||||
let request = SaveFileRequest::default()
|
||||
.modal(true)
|
||||
.title("Select new path")
|
||||
.accept_label("Accept")
|
||||
.current_folder(directory);
|
||||
|
||||
let result = if let Ok(request) = request {
|
||||
request
|
||||
.send()
|
||||
.await
|
||||
.ok()
|
||||
@ -327,7 +331,10 @@ impl<P: LinuxClient + 'static> Platform for P {
|
||||
.uris()
|
||||
.first()
|
||||
.and_then(|uri| uri.to_file_path().ok())
|
||||
});
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
done_tx.send(result);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user