Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: When deleting a file from the project navigator, the alert says (Function) in place of the filename #1492

Merged
merged 4 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ final class CEWorkspaceFile: Codable, Comparable, Hashable, Identifiable, Editor
}

/// Returns the file name with optional extension (e.g.: `Package.swift`)
func fileName(typeHidden: Bool) -> String {
func fileName(typeHidden: Bool = false) -> String {
typeHidden ? url.deletingPathExtension().lastPathComponent : name
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extension CEWorkspaceFileManager {
let deleteConfirmation = NSAlert()
let message: String
if !file.isFolder || file.isEmptyFolder { // if its a file or an empty folder, call it by its name
message = String(describing: file.fileName)
message = file.name
} else {
let childrenCount = try? fileManager.contentsOfDirectory(
at: file.url,
Expand Down