windows: Bring back restoration of tabs (#25870)

Closes #25022

Release Notes:

- N/A
This commit is contained in:
张小白 2025-03-02 01:18:34 +08:00 committed by GitHub
parent 48e09c0026
commit 6713ec8cdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -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 { impl<T: AsRef<Path>> From<T> for SanitizedPath {
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
fn from(path: T) -> Self { fn from(path: T) -> Self {

View file

@ -17,7 +17,7 @@ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
sync::Arc, sync::Arc,
}; };
use util::ResultExt; use util::{paths::SanitizedPath, ResultExt};
use uuid::Uuid; use uuid::Uuid;
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
@ -98,7 +98,7 @@ impl LocalPaths {
pub fn new<P: AsRef<Path>>(paths: impl IntoIterator<Item = P>) -> Self { pub fn new<P: AsRef<Path>>(paths: impl IntoIterator<Item = P>) -> Self {
let mut paths: Vec<PathBuf> = paths let mut paths: Vec<PathBuf> = paths
.into_iter() .into_iter()
.map(|p| p.as_ref().to_path_buf()) .map(|p| SanitizedPath::from(p).into())
.collect(); .collect();
// Ensure all future `zed workspace1 workspace2` and `zed workspace2 workspace1` calls are using the same workspace. // 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. // The actual workspace order is stored in the `LocalPathsOrder` struct.