We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0516eb1 commit a435345Copy full SHA for a435345
1 file changed
CodeEdit/Breadcrumbs/BreadcrumbsView.swift
@@ -65,11 +65,14 @@ struct BreadcrumbsView: View {
65
}
66
67
private func fileInfo(_ file: WorkspaceClient.FileItem) {
68
- guard let projName = workspace.fileURL?.lastPathComponent,
69
- var components = file.url.pathComponents.split(separator: projName).last else { return }
70
- components.removeLast()
+ guard let projURL = workspace.fileURL else { return }
+ let components = file.url.path
+ .replacingOccurrences(of: projURL.path, with: "")
71
+ .split(separator: "/")
72
+ .map { String($0) }
73
+ .dropLast()
74
- self.projectName = projName
75
+ self.projectName = projURL.lastPathComponent
76
self.folders = Array(components)
77
self.fileName = file.fileName
78
self.fileImage = file.systemImage
0 commit comments