open picker (#14524)

Release Notes:

- linux: Added a fallback Open picker for when XDG is not working
- Added a new setting `use_system_path_prompts` (default true) that can
be disabled to use Zed's builtin keyboard-driven prompts.

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-07-15 17:04:15 -06:00 committed by GitHub
parent da33aac156
commit abc5abcd8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 453 additions and 69 deletions

View file

@ -197,14 +197,12 @@ pub struct NewPathDelegate {
}
impl NewPathPrompt {
pub(crate) fn register(workspace: &mut Workspace, cx: &mut ViewContext<Workspace>) {
if workspace.project().read(cx).is_remote() {
workspace.set_prompt_for_new_path(Box::new(|workspace, cx| {
let (tx, rx) = futures::channel::oneshot::channel();
Self::prompt_for_new_path(workspace, tx, cx);
rx
}));
}
pub(crate) fn register(workspace: &mut Workspace, _cx: &mut ViewContext<Workspace>) {
workspace.set_prompt_for_new_path(Box::new(|workspace, cx| {
let (tx, rx) = futures::channel::oneshot::channel();
Self::prompt_for_new_path(workspace, tx, cx);
rx
}));
}
fn prompt_for_new_path(