mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 10:20:51 +00:00
Return proper full paths for single file workspaces
This commit is contained in:
parent
29a32039ba
commit
fd6f6cc9f8
1 changed files with 6 additions and 6 deletions
|
@ -2662,12 +2662,12 @@ impl language::File for File {
|
|||
|
||||
impl language::LocalFile for File {
|
||||
fn abs_path(&self, cx: &AppContext) -> PathBuf {
|
||||
self.worktree
|
||||
.read(cx)
|
||||
.as_local()
|
||||
.unwrap()
|
||||
.abs_path
|
||||
.join(&self.path)
|
||||
let worktree_path = &self.worktree.read(cx).as_local().unwrap().abs_path;
|
||||
if self.path.as_ref() == Path::new("") {
|
||||
worktree_path.to_path_buf()
|
||||
} else {
|
||||
worktree_path.join(&self.path)
|
||||
}
|
||||
}
|
||||
|
||||
fn load(&self, cx: &AppContext) -> Task<Result<String>> {
|
||||
|
|
Loading…
Reference in a new issue