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:
Kirill Bulatov 2025-04-07 19:25:43 -06:00 committed by GitHub
parent bfe08e449f
commit 1264e7a200
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 111 additions and 80 deletions

View file

@ -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)
}
}