mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 21:26:14 +03:00
Return proper full paths for single file workspaces
This commit is contained in:
parent
29a32039ba
commit
fd6f6cc9f8
@ -2662,12 +2662,12 @@ impl language::File for File {
|
|||||||
|
|
||||||
impl language::LocalFile for File {
|
impl language::LocalFile for File {
|
||||||
fn abs_path(&self, cx: &AppContext) -> PathBuf {
|
fn abs_path(&self, cx: &AppContext) -> PathBuf {
|
||||||
self.worktree
|
let worktree_path = &self.worktree.read(cx).as_local().unwrap().abs_path;
|
||||||
.read(cx)
|
if self.path.as_ref() == Path::new("") {
|
||||||
.as_local()
|
worktree_path.to_path_buf()
|
||||||
.unwrap()
|
} else {
|
||||||
.abs_path
|
worktree_path.join(&self.path)
|
||||||
.join(&self.path)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load(&self, cx: &AppContext) -> Task<Result<String>> {
|
fn load(&self, cx: &AppContext) -> Task<Result<String>> {
|
||||||
|
Loading…
Reference in New Issue
Block a user