mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
windows: Fix opening wrong path when clicking path in the terminal view (#18726)
Closes #18550 This PR removes the prefix `\\?\`. https://github.com/user-attachments/assets/f4f4333c-5d87-4f0f-b12c-fb2108703b6a Release Notes: - N/A
This commit is contained in:
parent
7d5fe66b54
commit
3ff52a816e
1 changed files with 15 additions and 0 deletions
|
@ -798,6 +798,7 @@ fn possible_open_paths_metadata(
|
|||
cx.background_executor().spawn(async move {
|
||||
let mut paths_with_metadata = Vec::with_capacity(potential_paths.len());
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let mut fetch_metadata_tasks = potential_paths
|
||||
.into_iter()
|
||||
.map(|potential_path| async {
|
||||
|
@ -813,6 +814,20 @@ fn possible_open_paths_metadata(
|
|||
})
|
||||
.collect::<FuturesUnordered<_>>();
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
let mut fetch_metadata_tasks = potential_paths
|
||||
.iter()
|
||||
.map(|potential_path| async {
|
||||
let metadata = fs.metadata(potential_path).await.ok().flatten();
|
||||
let path = PathBuf::from(
|
||||
potential_path
|
||||
.to_string_lossy()
|
||||
.trim_start_matches("\\\\?\\"),
|
||||
);
|
||||
(PathWithPosition { path, row, column }, metadata)
|
||||
})
|
||||
.collect::<FuturesUnordered<_>>();
|
||||
|
||||
while let Some((path, metadata)) = fetch_metadata_tasks.next().await {
|
||||
if let Some(metadata) = metadata {
|
||||
paths_with_metadata.push((path, metadata));
|
||||
|
|
Loading…
Reference in a new issue