Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
windows: Bring back restoration of tabs (#25870)
张小白6713ec8cdfbf
diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rsindex f333f285fd5..1852f4f44cb 100644--- a/crates/util/src/paths.rs+++ b/crates/util/src/paths.rs@@ -146,6 +146,12 @@ impl From<SanitizedPath> for Arc<Path> {}}+impl From<SanitizedPath> for PathBuf {+ fn from(sanitized_path: SanitizedPath) -> Self {+ sanitized_path.0.as_ref().into()+ }+}+impl<T: AsRef<Path>> From<T> for SanitizedPath {#[cfg(not(target_os = "windows"))]fn from(path: T) -> Self {diff --git a/crates/workspace/src/persistence/model.rs b/crates/workspace/src/persistence/model.rsindex b9d0b69ac02..f4c20544dbb 100644--- a/crates/workspace/src/persistence/model.rs+++ b/crates/workspace/src/persistence/model.rs@@ -17,7 +17,7 @@ use std::{path::{Path, PathBuf},sync::Arc,};-use util::ResultExt;+use util::{paths::SanitizedPath, ResultExt};use uuid::Uuid;#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]@@ -98,7 +98,7 @@ impl LocalPaths {pub fn new<P: AsRef<Path>>(paths: impl IntoIterator<Item = P>) -> Self {let mut paths: Vec<PathBuf> = paths.into_iter()- .map(|p| p.as_ref().to_path_buf())+ .map(|p| SanitizedPath::from(p).into()).collect();// Ensure all future `zed workspace1 workspace2` and `zed workspace2 workspace1` calls are using the same workspace.// The actual workspace order is stored in the `LocalPathsOrder` struct.