Properly store editor restoration data (#28296)
We cannot compare versions and anchors between different `Buffer`s with different `BufferId`s. Release Notes: - Fixed Zed panicking on editor reopen Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
bfe08e449f
commit
1264e7a200
3 changed files with 111 additions and 80 deletions
|
@ -3284,11 +3284,11 @@ impl language::File for File {
|
|||
|
||||
impl language::LocalFile for File {
|
||||
fn abs_path(&self, cx: &App) -> PathBuf {
|
||||
let worktree_path = &self.worktree.read(cx).as_local().unwrap().abs_path;
|
||||
let worktree_path = &self.worktree.read(cx).abs_path();
|
||||
if self.path.as_ref() == Path::new("") {
|
||||
worktree_path.as_path().to_path_buf()
|
||||
worktree_path.to_path_buf()
|
||||
} else {
|
||||
worktree_path.as_path().join(&self.path)
|
||||
worktree_path.join(&self.path)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue