Allow opening buffers without a project entry

This commit is contained in:
Kirill Bulatov 2023-12-04 12:56:02 +02:00
parent ae6ddceb67
commit 1f6c69c7dc
8 changed files with 228 additions and 90 deletions

View file

@ -1549,6 +1549,7 @@ impl Workspace {
let abs_path = abs_path.clone();
async move {
let (worktree, project_path) = project_path?;
// TODO kb consider excluded files here?
if fs.is_file(&abs_path).await {
Some(
this.update(&mut cx, |this, cx| {
@ -2129,13 +2130,13 @@ impl Workspace {
})
}
pub(crate) fn load_path(
fn load_path(
&mut self,
path: ProjectPath,
cx: &mut ViewContext<Self>,
) -> Task<
Result<(
ProjectEntryId,
Option<ProjectEntryId>,
impl 'static + FnOnce(&mut ViewContext<Pane>) -> Box<dyn ItemHandle>,
)>,
> {